m68k: invoke oom-killer from page fault
authorNick Piggin <[email protected]>
Thu, 22 Apr 2010 16:06:20 +0000 (02:06 +1000)
committerGeert Uytterhoeven <[email protected]>
Mon, 17 May 2010 19:37:39 +0000 (21:37 +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.

Cc: [email protected]
Cc: Geert Uytterhoeven <[email protected]>
Cc: [email protected]
Signed-off-by: Nick Piggin <[email protected]>
Acked-by: David Rientjes <[email protected]>
[Geert] Kill 2 introduced compiler warnings
Signed-off-by: Geert Uytterhoeven <[email protected]>
arch/m68k/mm/fault.c

index d0e35cf99fc69a531cb0239277c3351525c13773..a96394a0333d3d3c82cd70fbd4beb4764b02f018 100644 (file)
@@ -154,7 +154,6 @@ good_area:
         * the fault.
         */
 
- survive:
        fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
 #ifdef DEBUG
        printk("handle_mm_fault returns %d\n",fault);
@@ -180,15 +179,10 @@ good_area:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (is_global_init(current)) {
-               yield();
-               down_read(&mm->mmap_sem);
-               goto survive;
-       }
-
-       printk("VM: killing process %s\n", current->comm);
-       if (user_mode(regs))
-               do_group_exit(SIGKILL);
+       if (!user_mode(regs))
+               goto no_context;
+       pagefault_out_of_memory();
+       return 0;
 
 no_context:
        current->thread.signo = SIGBUS;