]> Git Repo - linux.git/commitdiff
mm,vmscan: don't pretend forward progress upon shrinker_rwsem contention
authorTetsuo Handa <[email protected]>
Thu, 5 Apr 2018 23:23:35 +0000 (16:23 -0700)
committerLinus Torvalds <[email protected]>
Fri, 6 Apr 2018 04:36:25 +0000 (21:36 -0700)
Since we no longer use return value of shrink_slab() for normal reclaim,
the comment is no longer true.  If some do_shrink_slab() call takes
unexpectedly long (root cause of stall is currently unknown) when
register_shrinker()/unregister_shrinker() is pending, trying to drop
caches via /proc/sys/vm/drop_caches could become infinite cond_resched()
loop if many mem_cgroup are defined.  For safety, let's not pretend
forward progress.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Tetsuo Handa <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Glauber Costa <[email protected]>
Cc: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/vmscan.c

index ca566640c44852ab8ce6a1681773ac7bf9b1d2a2..976be140a8ce9bab3deb57f531a81f22f98a6a0f 100644 (file)
@@ -442,16 +442,8 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
        if (memcg && (!memcg_kmem_enabled() || !mem_cgroup_online(memcg)))
                return 0;
 
-       if (!down_read_trylock(&shrinker_rwsem)) {
-               /*
-                * If we would return 0, our callers would understand that we
-                * have nothing else to shrink and give up trying. By returning
-                * 1 we keep it going and assume we'll be able to shrink next
-                * time.
-                */
-               freed = 1;
+       if (!down_read_trylock(&shrinker_rwsem))
                goto out;
-       }
 
        list_for_each_entry(shrinker, &shrinker_list, list) {
                struct shrink_control sc = {
This page took 0.060923 seconds and 4 git commands to generate.