From 7da81e89b5e83f50f63a544ff4490d0a4ce1c725 Mon Sep 17 00:00:00 2001 From: Prashant Gaikwad Date: Mon, 12 Aug 2013 16:02:28 +0530 Subject: UPSTREAM mm: invoke oom-killer from remaining unconverted page fault handlers A few remaining architectures directly kill the page faulting task in an out of memory situation. This is usually not a good idea since that task might not even use a significant amount of memory and so may not be the optimal victim to resolve the situation. Since 2.6.29's 1c0fe6e ("mm: invoke oom-killer from page fault") there is a hook that architecture page fault handlers are supposed to call to invoke the OOM killer and let it pick the right task to kill. Convert the remaining architectures over to this hook. To have the previous behavior of simply taking out the faulting task the vm.oom_kill_allocating_task sysctl can be set to 1. Signed-off-by: Johannes Weiner Reviewed-by: Michal Hocko Cc: KAMEZAWA Hiroyuki Acked-by: David Rientjes Acked-by: Vineet Gupta [arch/arc bits] Cc: James Hogan Cc: David Howells Cc: Jonas Bonn Cc: Chen Liqin Cc: Lennox Wu Cc: Chris Metcalf Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit 609838cfed972d49a65aac7923a9ff5cbe482e30) Conflicts: arch/arc/mm/fault.c arch/metag/mm/fault.c Change-Id: I3a9435be0bd4b8ea43cefd87ca8d408201ae3bf1 Signed-off-by: Prashant Gaikwad Reviewed-on: http://git-master/r/266408 GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam --- arch/tile/mm/fault.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/tile') diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c index 3d2b81c163a6..f7f99f90cbe0 100644 --- a/arch/tile/mm/fault.c +++ b/arch/tile/mm/fault.c @@ -573,10 +573,10 @@ out_of_memory: down_read(&mm->mmap_sem); goto survive; } - pr_alert("VM: killing process %s\n", tsk->comm); - if (!is_kernel_mode) - do_group_exit(SIGKILL); - goto no_context; + if (is_kernel_mode) + goto no_context; + pagefault_out_of_memory(); + return 0; do_sigbus: up_read(&mm->mmap_sem); -- cgit v1.2.3