Commit 760265401f255337347c42bc8fb0b9c1c682d904

Authored by Vladimir Davydov
Committed by Jiri Slaby
1 parent 671133cd6b

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

commit ec97097bca147d5718a5d2c024d1ec740b10096d upstream.

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>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>

Showing 1 changed file with 10 additions and 9 deletions Side-by-side Diff

... ... @@ -369,16 +369,17 @@
369 369 }
370 370  
371 371 list_for_each_entry(shrinker, &shrinker_list, list) {
372   - for_each_node_mask(shrinkctl->nid, shrinkctl->nodes_to_scan) {
373   - if (!node_online(shrinkctl->nid))
374   - continue;
375   -
376   - if (!(shrinker->flags & SHRINKER_NUMA_AWARE) &&
377   - (shrinkctl->nid != 0))
378   - break;
379   -
  372 + if (!(shrinker->flags & SHRINKER_NUMA_AWARE)) {
  373 + shrinkctl->nid = 0;
380 374 freed += shrink_slab_node(shrinkctl, shrinker,
381   - nr_pages_scanned, lru_pages);
  375 + nr_pages_scanned, lru_pages);
  376 + continue;
  377 + }
  378 +
  379 + for_each_node_mask(shrinkctl->nid, shrinkctl->nodes_to_scan) {
  380 + if (node_online(shrinkctl->nid))
  381 + freed += shrink_slab_node(shrinkctl, shrinker,
  382 + nr_pages_scanned, lru_pages);
382 383  
383 384 }
384 385 }