The patch titled Subject: mm/failslab.c: by default, do not fail allocations with direct reclaim only has been added to the -mm tree. Its filename is mm-failslab-by-default-do-not-fail-allocations-with-direct-reclaim-only.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-failslab-by-default-do-not-fail-allocations-with-direct-reclaim-only.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-failslab-by-default-do-not-fail-allocations-with-direct-reclaim-only.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/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Nicolas Boichat <drinkcat@xxxxxxxxxxxx> Subject: mm/failslab.c: by default, do not fail allocations with direct reclaim only When failslab was originally written, the intention of the "ignore-gfp-wait" flag default value ("N") was to fail GFP_ATOMIC allocations. Those were defined as (__GFP_HIGH), and the code would test for __GFP_WAIT (0x10u). However, since then, __GFP_WAIT was replaced by __GFP_RECLAIM (___GFP_DIRECT_RECLAIM|___GFP_KSWAPD_RECLAIM), and GFP_ATOMIC is now defined as (__GFP_HIGH|__GFP_ATOMIC|__GFP_KSWAPD_RECLAIM). This means that when the flag is false, almost no allocation ever fails (as even GFP_ATOMIC allocations contain ___GFP_KSWAPD_RECLAIM). Restore the original intent of the code, by ignoring calls that directly reclaim only (__GFP_DIRECT_RECLAIM), and thus, failing GFP_ATOMIC calls again by default. Link: http://lkml.kernel.org/r/20190520214514.81360-1-drinkcat@xxxxxxxxxxxx Fixes: 71baba4b92dc1fa1 ("mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM") Signed-off-by: Nicolas Boichat <drinkcat@xxxxxxxxxxxx> Reviewed-by: Akinobu Mita <akinobu.mita@xxxxxxxxx> Acked-by: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/failslab.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/failslab.c~mm-failslab-by-default-do-not-fail-allocations-with-direct-reclaim-only +++ a/mm/failslab.c @@ -23,7 +23,8 @@ bool __should_failslab(struct kmem_cache if (gfpflags & __GFP_NOFAIL) return false; - if (failslab.ignore_gfp_reclaim && (gfpflags & __GFP_RECLAIM)) + if (failslab.ignore_gfp_reclaim && + (gfpflags & __GFP_DIRECT_RECLAIM)) return false; if (failslab.cache_filter && !(s->flags & SLAB_FAILSLAB)) _ Patches currently in -mm which might be from drinkcat@xxxxxxxxxxxx are mm-failslab-by-default-do-not-fail-allocations-with-direct-reclaim-only.patch