From: Vladimir Davydov Date: Thu, 3 Apr 2014 21:47:19 +0000 (-0700) Subject: mm: vmscan: respect NUMA policy mask when shrinking slab on direct reclaim X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=99120b772b52853f9a2b829a21dd44d9b20558f1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mm: vmscan: respect NUMA policy mask when shrinking slab on direct reclaim When direct reclaim is executed by a process bound to a set of NUMA nodes, we should scan only those nodes when possible, but currently we will scan kmem from all online nodes even if the kmem shrinker is NUMA aware. That said, binding a process to a particular NUMA node won't prevent it from shrinking inode/dentry caches from other nodes, which is not good. Fix this. Signed-off-by: Vladimir Davydov Cc: Mel Gorman Cc: Michal Hocko Cc: Johannes Weiner Cc: Rik van Riel Cc: Dave Chinner Cc: Glauber Costa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index a9c74b409681..4acee0fe65e7 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2425,8 +2425,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, unsigned long lru_pages = 0; nodes_clear(shrink->nodes_to_scan); - for_each_zone_zonelist(zone, z, zonelist, - gfp_zone(sc->gfp_mask)) { + for_each_zone_zonelist_nodemask(zone, z, zonelist, + gfp_zone(sc->gfp_mask), sc->nodemask) { if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) continue;