The patch titled Subject: mm,vmscan: don't pretend forward progress upon shrinker_rwsem contention has been added to the -mm tree. Its filename is mmvmscan-dont-pretend-forward-progress-upon-shrinker_rwsem-contention.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mmvmscan-dont-pretend-forward-progress-upon-shrinker_rwsem-contention.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mmvmscan-dont-pretend-forward-progress-upon-shrinker_rwsem-contention.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Subject: mm,vmscan: don't pretend forward progress upon shrinker_rwsem contention 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/201802202229.GGF26507.LVFtMSOOHFJOQF@xxxxxxxxxxxxxxxxxxx Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Dave Chinner <dchinner@xxxxxxxxxx> Cc: Glauber Costa <glommer@xxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmscan.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff -puN mm/vmscan.c~mmvmscan-dont-pretend-forward-progress-upon-shrinker_rwsem-contention mm/vmscan.c --- a/mm/vmscan.c~mmvmscan-dont-pretend-forward-progress-upon-shrinker_rwsem-contention +++ a/mm/vmscan.c @@ -442,16 +442,8 @@ static unsigned long shrink_slab(gfp_t g 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 = { _ Patches currently in -mm which might be from penguin-kernel@xxxxxxxxxxxxxxxxxxx are dentry-fix-kmemcheck-splat-at-take_dentry_name_snapshot.patch mmvmscan-dont-pretend-forward-progress-upon-shrinker_rwsem-contention.patch mmvmscan-mark-register_shrinker-as-__must_check.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html