nios2: mm: do not invoke OOM killer on kernel fault OOM
authorLey Foon Tan <lftan@altera.com>
Mon, 16 Mar 2015 07:35:25 +0000 (15:35 +0800)
committerLey Foon Tan <lftan@altera.com>
Mon, 16 Mar 2015 07:35:25 +0000 (15:35 +0800)
Follow commit 871341023c771ad.

Kernel faults are expected to handle OOM conditions gracefully (gup,
uaccess etc.), so they should never invoke the OOM killer.  Reserve
this for faults triggered in user context when it is the only option.

Signed-off-by: Ley Foon Tan <lftan@altera.com>
arch/nios2/mm/fault.c

index 0d231adfe576b897073c924e02211dea7b110285..0c9b6afe69e9094815cc1e73084422368b3a2e52 100644 (file)
@@ -126,7 +126,6 @@ good_area:
                break;
        }
 
-survive:
        /*
         * If for any reason at all we couldn't handle the fault,
         * make sure we exit gracefully rather than endlessly redo
@@ -220,11 +219,6 @@ no_context:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (is_global_init(tsk)) {
-               yield();
-               down_read(&mm->mmap_sem);
-               goto survive;
-       }
        if (!user_mode(regs))
                goto no_context;
        pagefault_out_of_memory();