linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm,oom_reaper: don't call mmput_async() without atomic_inc_not_zero()
@ 2016-05-28  8:16 Tetsuo Handa
  2016-05-30  6:52 ` Michal Hocko
  2016-06-01 22:53 ` Andrew Morton
  0 siblings, 2 replies; 8+ messages in thread
From: Tetsuo Handa @ 2016-05-28  8:16 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, Tetsuo Handa, Michal Hocko, Arnd Bergmann

Commit e2fe14564d3316d1 ("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.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 mm/oom_kill.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index dfb1ab6..0d781b8 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -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;
 	}
 
-- 
1.8.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-03  6:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28  8:16 [PATCH] mm,oom_reaper: don't call mmput_async() without atomic_inc_not_zero() Tetsuo Handa
2016-05-30  6:52 ` Michal Hocko
2016-06-01 22:53 ` Andrew Morton
2016-06-02  6:48   ` Michal Hocko
2016-06-02 12:20     ` Tetsuo Handa
2016-06-02 13:11       ` Michal Hocko
2016-06-03  6:23         ` Michal Hocko
2016-06-02 13:49       ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).