mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
mm,oom_reaper: don't call mmput_async() without atomic_inc_not_zero()
Commit e2fe14564d
("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>
This commit is contained in:
parent
63c04ee7d3
commit
491a1c65ae
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user