[Devel] [PATCH vz8 18/19] mm/vmscan.c: move check for SHRINKER_NUMA_AWARE to do_shrink_slab()
Andrey Ryabinin
aryabinin at virtuozzo.com
Fri Mar 27 19:45:28 MSK 2020
From: Kirill Tkhai <ktkhai at virtuozzo.com>
In case of shrink_slab_memcg() we do not zero nid, when shrinker is not
numa-aware. This is not a real problem, since currently all memcg-aware
shrinkers are numa-aware too (we have two: super_block shrinker and
workingset shrinker), but something may change in the future.
Link: http://lkml.kernel.org/r/153320759911.18959.8842396230157677671.stgit@localhost.localdomain
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
Reviewed-by: Andrew Morton <akpm at linux-foundation.org>
Cc: Vladimir Davydov <vdavydov.dev at gmail.com>
Cc: Michal Hocko <mhocko at suse.com>
Cc: Andrey Ryabinin <aryabinin at virtuozzo.com>
Cc: "Huang, Ying" <ying.huang at intel.com>
Cc: Tetsuo Handa <penguin-kernel at I-love.SAKURA.ne.jp>
Cc: Matthew Wilcox <willy at infradead.org>
Cc: Shakeel Butt <shakeelb at google.com>
Cc: Josef Bacik <jbacik at fb.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
(cherry picked from commit ac7fb3ad2717c56cee70456ffe9d808230db528e)
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
mm/vmscan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index cdf75a69f6f9..18e4f74e1ab3 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -423,6 +423,9 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
: SHRINK_BATCH;
long scanned = 0, next_deferred;
+ if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
+ nid = 0;
+
freeable = shrinker->count_objects(shrinker, shrinkctl);
if (freeable == 0 || freeable == SHRINK_EMPTY)
return freeable;
@@ -652,9 +655,6 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
.for_drop_caches = for_drop_caches,
};
- if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
- sc.nid = 0;
-
ret = do_shrink_slab(&sc, shrinker, priority);
if (ret == SHRINK_EMPTY)
ret = 0;
--
2.24.1
More information about the Devel
mailing list