RE: [patch 03/14] cris: invoke oom-killer from page fault

Mikael Starvik
2010-04-23T04:34:00Z

Signed-off-by: Mikael Starvik <starvik@axis.com>

-----Original Message-----
From: npiggin@suse.de [mailto:npiggin@suse.de]
Sent: den 22 april 2010 18:06
To: linux-arch@vger.kernel.org
Cc: David Rientjes; Andrew Morton; linux-cris-kernel; Mikael Starvik
Subject: [patch 03/14] cris: invoke oom-killer from page fault

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-cris-kernel@axis.com
Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/cris/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/cris/mm/fault.c
+++ linux-2.6/arch/cris/mm/fault.c
@@ -245,10 +245,10 @@ do_page_fault(unsigned long address, str

out_of_memory:
up_read(&mm->mmap_sem);
- printk("VM: killing process %s\n", tsk->comm);
- if (user_mode(regs))
- do_exit(SIGKILL);
- goto no_context;
+ if (!user_mode(regs))
+ goto no_context;
+ pagefault_out_of_memory();
+ return;

do_sigbus:
up_read(&mm->mmap_sem);