CRIS: invoke oom-killer from page fault
Jesper Nilsson [Fri, 30 Jul 2010 16:34:16 +0000 (18:34 +0200)]
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.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Mikael Starvik <starvik@axis.com>

arch/cris/mm/fault.c

index 380df1a..52b32b0 100644 (file)
@@ -245,10 +245,10 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
 
  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);