diff options
author | Michal Hocko <mhocko@suse.com> | 2016-05-21 01:57:18 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-21 02:58:30 +0200 |
commit | bb8a4b7fd1266ef888b3a80aa5f266062b224ef4 (patch) | |
tree | 35f8d6d151acfd18bd3f030acf0f5e9d96cdfeec /kernel | |
parent | mm, oom: protect !costly allocations some more for !CONFIG_COMPACTION (diff) | |
download | linux-bb8a4b7fd1266ef888b3a80aa5f266062b224ef4.tar.xz linux-bb8a4b7fd1266ef888b3a80aa5f266062b224ef4.zip |
mm, oom_reaper: hide oom reaped tasks from OOM killer more carefully
Commit 36324a990cf5 ("oom: clear TIF_MEMDIE after oom_reaper managed to
unmap the address space") not only clears TIF_MEMDIE for oom reaped task
but also set OOM_SCORE_ADJ_MIN for the target task to hide it from the
oom killer. This works in simple cases but it is not sufficient for
(unlikely) cases where the mm is shared between independent processes
(as they do not share signal struct). If the mm had only small amount
of memory which could be reaped then another task sharing the mm could
be selected and that wouldn't help to move out from the oom situation.
Introduce MMF_OOM_REAPED mm flag which is checked in oom_badness (same
as OOM_SCORE_ADJ_MIN) and task is skipped if the flag is set. Set the
flag after __oom_reap_task is done with a task. This will force the
select_bad_process() to ignore all already oom reaped tasks as well as
no such task is sacrificed for its parent.
Signed-off-by: Michal Hocko <mhocko@suse.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions