Commit c7c1e384 authored by Ralf Baechle's avatar Ralf Baechle

MIPS: Port "mm: invoke oom-killer from page fault" from UML / x86

Original commit 1c0fe6e3.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent a8ca8b64
...@@ -97,7 +97,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, ...@@ -97,7 +97,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
goto bad_area; goto bad_area;
} }
survive:
/* /*
* If for any reason at all we couldn't handle the fault, * If for any reason at all we couldn't handle the fault,
* make sure we exit gracefully rather than endlessly redo * make sure we exit gracefully rather than endlessly redo
...@@ -167,21 +166,13 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, ...@@ -167,21 +166,13 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
field, regs->regs[31]); field, regs->regs[31]);
die("Oops", regs); die("Oops", regs);
/*
* We ran out of memory, or some other thing happened to us that made
* us unable to handle the page fault gracefully.
*/
out_of_memory: out_of_memory:
up_read(&mm->mmap_sem); /*
if (is_global_init(tsk)) { * We ran out of memory, call the OOM killer, and return the userspace
yield(); * (which will retry the fault, or kill us if we got oom-killed).
down_read(&mm->mmap_sem); */
goto survive; pagefault_out_of_memory();
} return;
printk("VM: killing process %s\n", tsk->comm);
if (user_mode(regs))
do_group_exit(SIGKILL);
goto no_context;
do_sigbus: do_sigbus:
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment