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: http://lkml.kernel.org/r/1464423365-5555-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jpSigned-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 63c04ee7
...@@ -478,6 +478,7 @@ static bool __oom_reap_task(struct task_struct *tsk) ...@@ -478,6 +478,7 @@ static bool __oom_reap_task(struct task_struct *tsk)
mm = p->mm; mm = p->mm;
if (!atomic_inc_not_zero(&mm->mm_users)) { if (!atomic_inc_not_zero(&mm->mm_users)) {
task_unlock(p); task_unlock(p);
mm = NULL;
goto unlock_oom; 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