Hi Andrew, although this can be folded into patch 5 (mm-oom_reaper-implement-oom-victims-queuing.patch) I think it would be better to have it separate and revert after we sort out the proper oom_kill_allocating_task behavior or handle exclusion at oom_reaper level. Thanks! --- >From 7d8c953994f97fb38a8d71b53c06ecf8418616e9 Mon Sep 17 00:00:00 2001 From: Michal Hocko <mhocko@xxxxxxxx> Date: Wed, 17 Feb 2016 10:40:41 +0100 Subject: [PATCH] oom, oom_reaper: disable oom_reaper for oom_kill_allocating_task Tetsuo has reported that oom_kill_allocating_task=1 will cause oom_reaper_list corruption because oom_kill_process doesn't follow standard OOM exclusion (aka ignores TIF_MEMDIE) and allows to enqueue the same task multiple times - e.g. by sacrificing the same child multiple times. Let's workaround this issue for now until we decide how to handle oom_kill_allocating_task properly (should it sacrifice children at all?) or come up with some other protection. Reported-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Michal Hocko <mhocko@xxxxxxxx> --- mm/oom_kill.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 7e9953a64489..078e07ec0906 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -678,7 +678,14 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p, unsigned int victim_points = 0; static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); - bool can_oom_reap = true; + bool can_oom_reap; + + /* + * XXX: oom_kill_allocating_task doesn't follow normal OOM exclusion + * and so the same task might enter oom_kill_process which oom_reaper + * cannot handle currently. + */ + can_oom_reap = !sysctl_oom_kill_allocating_task; /* * If the task is already exiting, don't alarm the sysadmin or kill -- 2.7.0 -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>