From: Ankita Garg Date: Sun, 18 Mar 2007 22:54:14 +0000 (-0400) Subject: oom fix: prevent oom from killing a process with children/sibling unkillable X-Git-Tag: v2.6.20.4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86fef703b93a7337ec932f12ca23ae365cb730a2;p=thirdparty%2Fkernel%2Fstable.git oom fix: prevent oom from killing a process with children/sibling unkillable Looking at oom_kill.c, found that the intention to not kill the selected process if any of its children/siblings has OOM_DISABLE set, is not being met. Signed-off-by: Ankita Garg Cc: Chuck Ebbert Acked-by: Nick Piggin Acked-by: William Irwin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index b278b8d60eee4..2f3916986abf7 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -320,7 +320,7 @@ static int oom_kill_task(struct task_struct *p) * Don't kill the process if any threads are set to OOM_DISABLE */ do_each_thread(g, q) { - if (q->mm == mm && p->oomkilladj == OOM_DISABLE) + if (q->mm == mm && q->oomkilladj == OOM_DISABLE) return 1; } while_each_thread(g, q);