patch-2.2.15 linux/arch/i386/mm/fault.c

Next file: linux/arch/m68k/kernel/ints.c
Previous file: linux/arch/i386/lib/delay.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from ../../exclude v2.2.14/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
@@ -291,7 +291,8 @@
 	up(&mm->mmap_sem);
 	if (error_code & 4)
 	{
-		if (!((regs->eflags >> 12) & 3))
+		if (tsk->oom_kill_try++ > 10 ||
+		    !((regs->eflags >> 12) & 3))
 		{
 			printk("VM: killing process %s\n", tsk->comm);
 			do_exit(SIGKILL);
@@ -304,6 +305,11 @@
 			 */
 			printk("VM: terminating process %s\n", tsk->comm);
 			force_sig(SIGTERM, current);
+			if (tsk->oom_kill_try > 1)
+			{
+				tsk->policy |= SCHED_YIELD;
+				schedule();
+			}
 			return;
 		}
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)