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

alpha: 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.

[mattst88: kill now unused 'survive' label]
Cc: linux-alpha@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: linux-arch@vger.kernel.org
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>

authored by

Nick Piggin and committed by
Matt Turner
1cb3d8e2 9ce34c8f

+2 -9
+2 -9
arch/alpha/mm/fault.c
··· 142 142 goto bad_area; 143 143 } 144 144 145 - survive: 146 145 /* If for any reason at all we couldn't handle the fault, 147 146 make sure we exit gracefully rather than endlessly redo 148 147 the fault. */ ··· 187 188 /* We ran out of memory, or some other thing happened to us that 188 189 made us unable to handle the page fault gracefully. */ 189 190 out_of_memory: 190 - if (is_global_init(current)) { 191 - yield(); 192 - down_read(&mm->mmap_sem); 193 - goto survive; 194 - } 195 - printk(KERN_ALERT "VM: killing process %s(%d)\n", 196 - current->comm, task_pid_nr(current)); 197 191 if (!user_mode(regs)) 198 192 goto no_context; 199 - do_group_exit(SIGKILL); 193 + pagefault_out_of_memory(); 194 + return; 200 195 201 196 do_sigbus: 202 197 /* Send a sigbus, regardless of whether we were in kernel