Commit 650a7c97 authored by David Rientjes's avatar David Rientjes Committed by Linus Torvalds

oom: kill all threads that share mm with killed task

oom_kill_task() calls __oom_kill_task() to OOM kill a selected task.
When finding other threads that share an mm with that task, we need to
kill those individual threads and not the same one.

(Bug introduced by f2a2a710)
Acked-by: default avatarWilliam Irwin <bill.irwin@oracle.com>
Acked-by: default avatarChristoph Lameter <clameter@engr.sgi.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c445a31c
...@@ -333,7 +333,7 @@ static int oom_kill_task(struct task_struct *p) ...@@ -333,7 +333,7 @@ static int oom_kill_task(struct task_struct *p)
*/ */
do_each_thread(g, q) { do_each_thread(g, q) {
if (q->mm == mm && q->tgid != p->tgid) if (q->mm == mm && q->tgid != p->tgid)
force_sig(SIGKILL, p); force_sig(SIGKILL, q);
} while_each_thread(g, q); } while_each_thread(g, q);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment