mm, oom: prevent premature OOM killer invocation for high order request
authorMichal Hocko <[email protected]>
Thu, 1 Sep 2016 23:14:41 +0000 (16:14 -0700)
committerLinus Torvalds <[email protected]>
Fri, 2 Sep 2016 00:52:01 +0000 (17:52 -0700)
commit6b4e3181d7bd5ca5ab6f45929e4a5ffa7ab4ab7f
tree3320f181ccbf14f313fd91e80a8daa757d449153
parent071e31e254e0e0c438eecba3dba1d6e2d0da36c2
mm, oom: prevent premature OOM killer invocation for high order request

There have been several reports about pre-mature OOM killer invocation
in 4.7 kernel when order-2 allocation request (for the kernel stack)
invoked OOM killer even during basic workloads (light IO or even kernel
compile on some filesystems).  In all reported cases the memory is
fragmented and there are no order-2+ pages available.  There is usually
a large amount of slab memory (usually dentries/inodes) and further
debugging has shown that there are way too many unmovable blocks which
are skipped during the compaction.  Multiple reporters have confirmed
that the current linux-next which includes [1] and [2] helped and OOMs
are not reproducible anymore.

A simpler fix for the late rc and stable is to simply ignore the
compaction feedback and retry as long as there is a reclaim progress and
we are not getting OOM for order-0 pages.  We already do that for
CONFING_COMPACTION=n so let's reuse the same code when compaction is
enabled as well.

[1] http://lkml.kernel.org/r/20160810091226[email protected]
[2] http://lkml.kernel.org/r/f7a9ea9d-bb88-bfd6-e340-3a933559305a@suse.cz

Fixes: 0a0337e0d1d1 ("mm, oom: rework oom detection")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Michal Hocko <[email protected]>
Tested-by: Olaf Hering <[email protected]>
Tested-by: Ralf-Peter Rohbeck <[email protected]>
Cc: Markus Trippelsdorf <[email protected]>
Cc: Arkadiusz Miskiewicz <[email protected]>
Cc: Ralf-Peter Rohbeck <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: <[email protected]> [4.7.x]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/page_alloc.c