Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec97097b authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Linus Torvalds
Browse files

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: default avatarVladimir Davydov <vdavydov@parallels.com>
Reported-by: default avatarDave 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0b1fb40a
Loading
Loading
Loading
Loading
+10 −9
Original line number Original line Diff line number Diff line
@@ -369,14 +369,15 @@ unsigned long shrink_slab(struct shrink_control *shrinkctl,
	}
	}


	list_for_each_entry(shrinker, &shrinker_list, list) {
	list_for_each_entry(shrinker, &shrinker_list, list) {
		for_each_node_mask(shrinkctl->nid, shrinkctl->nodes_to_scan) {
		if (!(shrinker->flags & SHRINKER_NUMA_AWARE)) {
			if (!node_online(shrinkctl->nid))
			shrinkctl->nid = 0;
			freed += shrink_slab_node(shrinkctl, shrinker,
					nr_pages_scanned, lru_pages);
			continue;
			continue;
		}


			if (!(shrinker->flags & SHRINKER_NUMA_AWARE) &&
		for_each_node_mask(shrinkctl->nid, shrinkctl->nodes_to_scan) {
			    (shrinkctl->nid != 0))
			if (node_online(shrinkctl->nid))
				break;

				freed += shrink_slab_node(shrinkctl, shrinker,
				freed += shrink_slab_node(shrinkctl, shrinker,
						nr_pages_scanned, lru_pages);
						nr_pages_scanned, lru_pages);