Commit 491a1c65 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Linus Torvalds

mm,oom_reaper: don't call mmput_async() without atomic_inc_not_zero()

Commit e2fe1456 ("oom_reaper: close race with exiting task") reduced
frequency of needlessly selecting next OOM victim, but was calling
mmput_async() when atomic_inc_not_zero() failed.

Link: default avatarTetsuo Handa <>
Acked-by: default avatarMichal Hocko <>
Cc: Arnd Bergmann <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 63c04ee7
......@@ -478,6 +478,7 @@ static bool __oom_reap_task(struct task_struct *tsk)
mm = p->mm;
if (!atomic_inc_not_zero(&mm->mm_users)) {
mm = NULL;
goto unlock_oom;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment