Patch from Rik van Riel <riel@imladris.surriel.com>

If a process cannot exit because it's stuck in eg.  a driver, it doesn't make
sense to have the OOM killer kill it repeatedly; that could lead to a hung
system.

Instead, kill another process if the first process we tried to kill hasn't
made any move to exit within 5 seconds.  This way we have a much better
chance of recovering the system.




 oom_kill.c |    3 +++
 1 files changed, 3 insertions(+)

diff -puN mm/oom_kill.c~oom-killer-dont-spin-on-same-task mm/oom_kill.c
--- 25/mm/oom_kill.c~oom-killer-dont-spin-on-same-task	2003-02-23 13:03:22.000000000 -0800
+++ 25-akpm/mm/oom_kill.c	2003-02-23 13:03:22.000000000 -0800
@@ -61,6 +61,9 @@ static int badness(struct task_struct *p
 
 	if (!p->mm)
 		return 0;
+
+	if (p->flags & PF_MEMDIE)
+		return 0;
 	/*
 	 * The memory size of the process is the basis for the badness.
 	 */

_