Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m32r: invoke oom-killer from page fault

As explained in commit 1c0fe6e3bd ("mm: invoke oom-killer from page
fault") , we want to call the architecture independent oom killer when
getting an unexplained OOM from handle_mm_fault, rather than simply
killing current.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Nick Piggin and committed by
Linus Torvalds
68db30ce f9c497c4

+4 -10
+4 -10
arch/m32r/mm/fault.c
··· 188 188 if ((error_code & ACE_INSTRUCTION) && !(vma->vm_flags & VM_EXEC)) 189 189 goto bad_area; 190 190 191 - survive: 192 191 /* 193 192 * If for any reason at all we couldn't handle the fault, 194 193 * make sure we exit gracefully rather than endlessly redo ··· 270 271 */ 271 272 out_of_memory: 272 273 up_read(&mm->mmap_sem); 273 - if (is_global_init(tsk)) { 274 - yield(); 275 - down_read(&mm->mmap_sem); 276 - goto survive; 277 - } 278 - printk("VM: killing process %s\n", tsk->comm); 279 - if (error_code & ACE_USERMODE) 280 - do_group_exit(SIGKILL); 281 - goto no_context; 274 + if (!(error_code & ACE_USERMODE)) 275 + goto no_context; 276 + pagefault_out_of_memory(); 277 + return; 282 278 283 279 do_sigbus: 284 280 up_read(&mm->mmap_sem);