diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2016-06-24 17:48:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-24 20:23:52 -0400 |
commit | 491a1c65ae498dea0e39b24a46e528a78a8532ed (patch) | |
tree | 81c945e8848f0a83f085dd54a310eb524cfbeca0 /mm | |
parent | 63c04ee7d3b7c8d8e2726cb7c5f8a5f6fcc1e3b2 (diff) |
mm,oom_reaper: don't call mmput_async() without atomic_inc_not_zero()
Commit e2fe14564d33 ("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.jp
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/oom_kill.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index acbc432d1a52..be67df3b6569 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -478,6 +478,7 @@ static bool __oom_reap_task(struct task_struct *tsk) | |||
478 | mm = p->mm; | 478 | mm = p->mm; |
479 | if (!atomic_inc_not_zero(&mm->mm_users)) { | 479 | if (!atomic_inc_not_zero(&mm->mm_users)) { |
480 | task_unlock(p); | 480 | task_unlock(p); |
481 | mm = NULL; | ||
481 | goto unlock_oom; | 482 | goto unlock_oom; |
482 | } | 483 | } |
483 | 484 | ||