]> Git Repo - linux.git/commitdiff
mm/vmscan.c: move check for SHRINKER_NUMA_AWARE to do_shrink_slab()
authorKirill Tkhai <[email protected]>
Fri, 17 Aug 2018 22:48:30 +0000 (15:48 -0700)
committerLinus Torvalds <[email protected]>
Fri, 17 Aug 2018 23:20:31 +0000 (16:20 -0700)
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 <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: "Huang, Ying" <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Shakeel Butt <[email protected]>
Cc: Josef Bacik <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/vmscan.c

index 93fdd0375b648ac6ecddcb97cbaf9d556cc92198..8fcc86f1d7bc3dd0ec4553bdbcd9f204955a78a1 100644 (file)
@@ -455,6 +455,9 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
                                          : SHRINK_BATCH;
        long scanned = 0, next_deferred;
 
                                          : 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;
        freeable = shrinker->count_objects(shrinker, shrinkctl);
        if (freeable == 0 || freeable == SHRINK_EMPTY)
                return freeable;
@@ -680,9 +683,6 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
                        .memcg = memcg,
                };
 
                        .memcg = memcg,
                };
 
-               if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
-                       sc.nid = 0;
-
                ret = do_shrink_slab(&sc, shrinker, priority);
                if (ret == SHRINK_EMPTY)
                        ret = 0;
                ret = do_shrink_slab(&sc, shrinker, priority);
                if (ret == SHRINK_EMPTY)
                        ret = 0;
This page took 0.061624 seconds and 4 git commands to generate.