Commit 6b6b18e6 authored by Nick Piggin's avatar Nick Piggin Committed by Paul Mundt

sh: invoke oom-killer from page fault

As explained in commit 1c0fe6e3, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-sh@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 4a6feab0
......@@ -290,15 +290,10 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
*/
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", tsk->comm);
if (user_mode(regs))
do_group_exit(SIGKILL);
if (!user_mode(regs))
goto no_context;
pagefault_out_of_memory();
return;
do_sigbus:
up_read(&mm->mmap_sem);
......
......@@ -294,22 +294,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
* us unable to handle the page fault gracefully.
*/
out_of_memory:
if (is_global_init(current)) {
panic("INIT out of memory\n");
yield();
goto survive;
}
printk("fault:Out of memory\n");
up_read(&mm->mmap_sem);
if (is_global_init(current)) {
yield();
down_read(&mm->mmap_sem);
goto survive;
}
printk("VM: killing process %s\n", tsk->comm);
if (user_mode(regs))
do_group_exit(SIGKILL);
if (!user_mode(regs))
goto no_context;
pagefault_out_of_memory();
return;
do_sigbus:
printk("fault:Do sigbus\n");
......
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