WSL2-Linux-Kernel/include
Michal Hocko 11a410d516 mm, oom_reaper: do not attempt to reap a task more than twice
oom_reaper relies on the mmap_sem for read to do its job.  Many places
which might block readers have been converted to use down_write_killable
and that has reduced chances of the contention a lot.  Some paths where
the mmap_sem is held for write can take other locks and they might
either be not prepared to fail due to fatal signal pending or too
impractical to be changed.

This patch introduces MMF_OOM_NOT_REAPABLE flag which gets set after the
first attempt to reap a task's mm fails.  If the flag is present after
the failure then we set MMF_OOM_REAPED to hide this mm from the oom
killer completely so it can go and chose another victim.

As a result a risk of OOM deadlock when the oom victim would be blocked
indefinetly and so the oom killer cannot make any progress should be
mitigated considerably while we still try really hard to perform all
reclaim attempts and stay predictable in the behavior.

Link: http://lkml.kernel.org/r/1466426628-15074-10-git-send-email-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-07-28 16:07:41 -07:00
..
acpi Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-apei' and 'acpi-sleep' 2016-07-25 13:42:25 +02:00
asm-generic Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
clocksource
crypto A number of improvements for the /dev/random driver; the most 2016-07-27 15:11:55 -07:00
drm
dt-bindings
keys
kvm
linux mm, oom_reaper: do not attempt to reap a task more than twice 2016-07-28 16:07:41 -07:00
math-emu
media
memory
misc
net net_sched: get rid of struct tcf_common 2016-07-25 21:49:20 -07:00
pcmcia
ras
rdma
rxrpc
scsi
soc
sound
target
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
uapi media updates for v4.8-rc1 2016-07-27 14:58:31 -07:00
video
xen xen: add static initialization of steal_clock op to xen_time_ops 2016-07-26 14:07:06 +01:00
Kbuild