summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2013-08-16 09:39:34 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2013-08-20 16:29:10 +1000
commitefa308cfd4ed7659007faed7cc04b48ceab2c647 (patch)
tree9e598da1e9709e1de33cb7e6428ddfcfa9ac33a5 /arch/mips
parente01f3768c77ee45799f942648bf07ac8c4d3257e (diff)
arch: mm: do not invoke OOM killer on kernel fault OOM
Kernel faults are expected to handle OOM conditions gracefully (gup, uaccess etc.), so they should never invoke the OOM killer. Reserve this for faults triggered in user context when it is the only option. Most architectures already do this, fix up the remaining few. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Michal Hocko <mhocko@suse.cz> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: David Rientjes <rientjes@google.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: azurIt <azurit@pobox.sk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/mm/fault.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 85df1cd8d446..94d3a31ab144 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -241,6 +241,8 @@ out_of_memory:
* (which will retry the fault, or kill us if we got oom-killed).
*/
up_read(&mm->mmap_sem);
+ if (!user_mode(regs))
+ goto no_context;
pagefault_out_of_memory();
return;