diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-06 03:15:58 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-06 03:15:58 -0400 |
commit | e460c2c91af44374cbfa3f1c70f5ca9bbf099aa9 (patch) | |
tree | 7b59d216c38c9a20c6fed47c93f3fed944d72219 /arch/powerpc/mm | |
parent | 91eea67c6d8704396a98226508c56a8501e141e3 (diff) |
powerpc: 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: linuxppc-dev@ozlabs.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/fault.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 83ac4935eb10..1bd712c33ce2 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
@@ -308,7 +308,6 @@ good_area: | |||
308 | * make sure we exit gracefully rather than endlessly redo | 308 | * make sure we exit gracefully rather than endlessly redo |
309 | * the fault. | 309 | * the fault. |
310 | */ | 310 | */ |
311 | survive: | ||
312 | ret = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0); | 311 | ret = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0); |
313 | if (unlikely(ret & VM_FAULT_ERROR)) { | 312 | if (unlikely(ret & VM_FAULT_ERROR)) { |
314 | if (ret & VM_FAULT_OOM) | 313 | if (ret & VM_FAULT_OOM) |
@@ -360,15 +359,10 @@ bad_area_nosemaphore: | |||
360 | */ | 359 | */ |
361 | out_of_memory: | 360 | out_of_memory: |
362 | up_read(&mm->mmap_sem); | 361 | up_read(&mm->mmap_sem); |
363 | if (is_global_init(current)) { | 362 | if (!user_mode(regs)) |
364 | yield(); | 363 | return SIGKILL; |
365 | down_read(&mm->mmap_sem); | 364 | pagefault_out_of_memory(); |
366 | goto survive; | 365 | return 0; |
367 | } | ||
368 | printk("VM: killing process %s\n", current->comm); | ||
369 | if (user_mode(regs)) | ||
370 | do_group_exit(SIGKILL); | ||
371 | return SIGKILL; | ||
372 | 366 | ||
373 | do_sigbus: | 367 | do_sigbus: |
374 | up_read(&mm->mmap_sem); | 368 | up_read(&mm->mmap_sem); |