The patch titled Subject: mm/vmscan.c: terminate shrink_slab loop if signal is pending has been added to the -mm tree. Its filename is mm-terminate-shrink_slab-loop-if-signal-is-pending.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-terminate-shrink_slab-loop-if-signal-is-pending.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-terminate-shrink_slab-loop-if-signal-is-pending.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: Suren Baghdasaryan <surenb@xxxxxxxxxx> Subject: mm/vmscan.c: terminate shrink_slab loop if signal is pending Slab shrinkers can be quite time consuming and when signal is pending they can delay handling of the signal. If fatal signal is pending there is no point in shrinking that process since it will be killed anyway. This change checks for pending fatal signals inside shrink_slab loop and if one is detected terminates this loop early. Link: http://lkml.kernel.org/r/20171206192026.25133-1-surenb@xxxxxxxxxx Signed-off-by: Suren Baghdasaryan <surenb@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Hillf Danton <hillf.zj@xxxxxxxxxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Huang Ying <ying.huang@xxxxxxxxx> Cc: Tim Murray <timmurray@xxxxxxxxxx> Cc: Todd Kjos <tkjos@xxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmscan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff -puN mm/vmscan.c~mm-terminate-shrink_slab-loop-if-signal-is-pending mm/vmscan.c --- a/mm/vmscan.c~mm-terminate-shrink_slab-loop-if-signal-is-pending +++ a/mm/vmscan.c @@ -487,6 +487,13 @@ static unsigned long shrink_slab(gfp_t g }; /* + * We are about to die and free our memory. + * Stop shrinking which might delay signal handling. + */ + if (unlikely(fatal_signal_pending(current)) + break; + + /* * If kernel memory accounting is disabled, we ignore * SHRINKER_MEMCG_AWARE flag and call all shrinkers * passing NULL for memcg. _ Patches currently in -mm which might be from surenb@xxxxxxxxxx are mm-terminate-shrink_slab-loop-if-signal-is-pending.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