diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-08-27 20:18:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-10 18:56:31 -0400 |
commit | 9b17c62382dd2e7507984b9890bf44e070cdd8bb (patch) | |
tree | e64979ddbd8f0b6924f6b940fa15804490301908 /fs/dcache.c | |
parent | 1d3d4437eae1bb2963faab427f65f90663c64aa1 (diff) |
fs: convert inode and dentry shrinking to be node aware
Now that the shrinker is passing a node in the scan control structure, we
can pass this to the the generic LRU list code to isolate reclaim to the
lists on matching nodes.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Glauber Costa <glommer@parallels.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Carlos Maiolino <cmaiolino@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Rientjes <rientjes@google.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: J. Bruce Fields <bfields@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Kent Overstreet <koverstreet@google.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index d74b5bdff7f9..c932ed32c77b 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -937,6 +937,7 @@ dentry_lru_isolate(struct list_head *item, spinlock_t *lru_lock, void *arg) | |||
937 | * prune_dcache_sb - shrink the dcache | 937 | * prune_dcache_sb - shrink the dcache |
938 | * @sb: superblock | 938 | * @sb: superblock |
939 | * @nr_to_scan : number of entries to try to free | 939 | * @nr_to_scan : number of entries to try to free |
940 | * @nid: which node to scan for freeable entities | ||
940 | * | 941 | * |
941 | * Attempt to shrink the superblock dcache LRU by @nr_to_scan entries. This is | 942 | * Attempt to shrink the superblock dcache LRU by @nr_to_scan entries. This is |
942 | * done when we need more memory an called from the superblock shrinker | 943 | * done when we need more memory an called from the superblock shrinker |
@@ -945,13 +946,14 @@ dentry_lru_isolate(struct list_head *item, spinlock_t *lru_lock, void *arg) | |||
945 | * This function may fail to free any resources if all the dentries are in | 946 | * This function may fail to free any resources if all the dentries are in |
946 | * use. | 947 | * use. |
947 | */ | 948 | */ |
948 | long prune_dcache_sb(struct super_block *sb, unsigned long nr_to_scan) | 949 | long prune_dcache_sb(struct super_block *sb, unsigned long nr_to_scan, |
950 | int nid) | ||
949 | { | 951 | { |
950 | LIST_HEAD(dispose); | 952 | LIST_HEAD(dispose); |
951 | long freed; | 953 | long freed; |
952 | 954 | ||
953 | freed = list_lru_walk(&sb->s_dentry_lru, dentry_lru_isolate, | 955 | freed = list_lru_walk_node(&sb->s_dentry_lru, nid, dentry_lru_isolate, |
954 | &dispose, nr_to_scan); | 956 | &dispose, &nr_to_scan); |
955 | shrink_dentry_list(&dispose); | 957 | shrink_dentry_list(&dispose); |
956 | return freed; | 958 | return freed; |
957 | } | 959 | } |