mm: vmscan: call NUMA-unaware shrinkers irrespective of nodemask

If a shrinker is not NUMA-aware, shrink_slab() should call it exactly
once with nid=0, but currently it is not true: if node 0 is not set in
the nodemask or if it is not online, we will not call such shrinkers at
all.  As a result some slabs will be left untouched under some
circumstances.  Let us fix it.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Reported-by: Dave Chinner <dchinner@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Glauber Costa <glommer@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Vladimir Davydov 2014-01-23 15:53:23 -08:00 committed by Linus Torvalds
parent 0b1fb40a3b
commit ec97097bca
1 changed files with 10 additions and 9 deletions

View File

@ -369,16 +369,17 @@ unsigned long shrink_slab(struct shrink_control *shrinkctl,
}
list_for_each_entry(shrinker, &shrinker_list, list) {
for_each_node_mask(shrinkctl->nid, shrinkctl->nodes_to_scan) {
if (!node_online(shrinkctl->nid))
continue;
if (!(shrinker->flags & SHRINKER_NUMA_AWARE) &&
(shrinkctl->nid != 0))
break;
if (!(shrinker->flags & SHRINKER_NUMA_AWARE)) {
shrinkctl->nid = 0;
freed += shrink_slab_node(shrinkctl, shrinker,
nr_pages_scanned, lru_pages);
nr_pages_scanned, lru_pages);
continue;
}
for_each_node_mask(shrinkctl->nid, shrinkctl->nodes_to_scan) {
if (node_online(shrinkctl->nid))
freed += shrink_slab_node(shrinkctl, shrinker,
nr_pages_scanned, lru_pages);
}
}