oom: kill all threads that share mm with killed task
authorDavid Rientjes <[email protected]>
Tue, 24 Apr 2007 04:36:13 +0000 (21:36 -0700)
committerLinus Torvalds <[email protected]>
Tue, 24 Apr 2007 15:11:49 +0000 (08:11 -0700)
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 f2a2a7108aa0039ba7a5fe7a0d2ecef2219a7584)

Acked-by: William Irwin <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Cc: Nick Piggin <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Andi Kleen <[email protected]>
Signed-off-by: David Rientjes <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/oom_kill.c

index 2f3916986abf7054bc00e4c2fc8ed2ed688d199b..af981b645a6904affee5320ef77869e10b8db278 100644 (file)
@@ -333,7 +333,7 @@ static int oom_kill_task(struct task_struct *p)
         */
        do_each_thread(g, q) {
                if (q->mm == mm && q->tgid != p->tgid)
-                       force_sig(SIGKILL, p);
+                       force_sig(SIGKILL, q);
        } while_each_thread(g, q);
 
        return 0;