Skip to content

Commit 491a1c6

Browse files
Tetsuo Handatorvalds
authored andcommitted
mm,oom_reaper: don't call mmput_async() without atomic_inc_not_zero()
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 <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>
1 parent 63c04ee commit 491a1c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mm/oom_kill.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ static bool __oom_reap_task(struct task_struct *tsk)
478478
mm = p->mm;
479479
if (!atomic_inc_not_zero(&mm->mm_users)) {
480480
task_unlock(p);
481+
mm = NULL;
481482
goto unlock_oom;
482483
}
483484

0 commit comments

Comments
 (0)