Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6347e2a1 authored by Ley Foon Tan's avatar Ley Foon Tan
Browse files

nios2: mm: do not invoke OOM killer on kernel fault OOM



Follow commit 87134102.

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: default avatarLey Foon Tan <lftan@altera.com>
parent c105e86a
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -126,7 +126,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long cause,
		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 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long cause,
 */
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();