aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-04-22 12:06:26 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-04-26 02:47:01 -0400
commit6b6b18e62cfba44ce7b6489c7100f12b199232d7 (patch)
treedb4a2c60dec3b6dcfbcd46d5e3f056dbac34d646 /arch/sh
parent4a6feab0ee5240c4bd5378d9f8a46b85718c68a7 (diff)
sh: invoke oom-killer from page fault
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: linux-sh@vger.kernel.org Cc: linux-arch@vger.kernel.org Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/mm/fault_32.c13
-rw-r--r--arch/sh/mm/tlbflush_64.c19
2 files changed, 8 insertions, 24 deletions
diff --git a/arch/sh/mm/fault_32.c b/arch/sh/mm/fault_32.c
index 8bf79e3b7bdd..93c3447ed40a 100644
--- a/arch/sh/mm/fault_32.c
+++ b/arch/sh/mm/fault_32.c
@@ -290,15 +290,10 @@ no_context:
290 */ 290 */
291out_of_memory: 291out_of_memory:
292 up_read(&mm->mmap_sem); 292 up_read(&mm->mmap_sem);
293 if (is_global_init(current)) { 293 if (!user_mode(regs))
294 yield(); 294 goto no_context;
295 down_read(&mm->mmap_sem); 295 pagefault_out_of_memory();
296 goto survive; 296 return;
297 }
298 printk("VM: killing process %s\n", tsk->comm);
299 if (user_mode(regs))
300 do_group_exit(SIGKILL);
301 goto no_context;
302 297
303do_sigbus: 298do_sigbus:
304 up_read(&mm->mmap_sem); 299 up_read(&mm->mmap_sem);
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index 706da1d3a67a..25bd64c0977c 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -294,22 +294,11 @@ no_context:
294 * us unable to handle the page fault gracefully. 294 * us unable to handle the page fault gracefully.
295 */ 295 */
296out_of_memory: 296out_of_memory:
297 if (is_global_init(current)) {
298 panic("INIT out of memory\n");
299 yield();
300 goto survive;
301 }
302 printk("fault:Out of memory\n");
303 up_read(&mm->mmap_sem); 297 up_read(&mm->mmap_sem);
304 if (is_global_init(current)) { 298 if (!user_mode(regs))
305 yield(); 299 goto no_context;
306 down_read(&mm->mmap_sem); 300 pagefault_out_of_memory();
307 goto survive; 301 return;
308 }
309 printk("VM: killing process %s\n", tsk->comm);
310 if (user_mode(regs))
311 do_group_exit(SIGKILL);
312 goto no_context;
313 302
314do_sigbus: 303do_sigbus:
315 printk("fault:Do sigbus\n"); 304 printk("fault:Do sigbus\n");