diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2013-07-08 18:59:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-09 13:33:20 -0400 |
commit | 609838cfed972d49a65aac7923a9ff5cbe482e30 (patch) | |
tree | b9043963715a04c84b4030ccd3951a32129a6ed8 /arch/score/mm | |
parent | 54f72fe022d9b2c4de40043a118881121190a117 (diff) |
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 <hannes@cmpxchg.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com> [arch/arc bits]
Cc: James Hogan <james.hogan@imgtec.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Chen Liqin <liqin.chen@sunplusct.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/score/mm')
-rw-r--r-- | arch/score/mm/fault.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/score/mm/fault.c b/arch/score/mm/fault.c index 47b600e4b2c5..6b18fb0189ae 100644 --- a/arch/score/mm/fault.c +++ b/arch/score/mm/fault.c | |||
@@ -172,10 +172,10 @@ out_of_memory: | |||
172 | down_read(&mm->mmap_sem); | 172 | down_read(&mm->mmap_sem); |
173 | goto survive; | 173 | goto survive; |
174 | } | 174 | } |
175 | printk("VM: killing process %s\n", tsk->comm); | 175 | if (!user_mode(regs)) |
176 | if (user_mode(regs)) | 176 | goto no_context; |
177 | do_group_exit(SIGKILL); | 177 | pagefault_out_of_memory(); |
178 | goto no_context; | 178 | return; |
179 | 179 | ||
180 | do_sigbus: | 180 | do_sigbus: |
181 | up_read(&mm->mmap_sem); | 181 | up_read(&mm->mmap_sem); |