Skip to content

Commit

Permalink
mm,oom_reaper: don't call mmput_async() without atomic_inc_not_zero()
Browse files Browse the repository at this point in the history
Commit e2fe145 ("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 <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Tetsuo Handa authored and torvalds committed Jun 25, 2016
1 parent 63c04ee commit 491a1c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ static bool __oom_reap_task(struct task_struct *tsk)
mm = p->mm;
if (!atomic_inc_not_zero(&mm->mm_users)) {
task_unlock(p);
mm = NULL;
goto unlock_oom;
}

Expand Down

0 comments on commit 491a1c6

Please sign in to comment.