aboutsummaryrefslogtreecommitdiffstats
path: root/arch/unicore32
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2013-09-12 18:13:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-12 18:38:01 -0400
commit871341023c771ad233620b7a1fb3d9c7031c4e5c (patch)
treef2b008756dffce639759f74885b23e92886600d6 /arch/unicore32
parent94bce453c78996cc4373d5da6cfabe07fcc6d9f9 (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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/unicore32')
-rw-r--r--arch/unicore32/mm/fault.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c
index f9b5c10bccee..8ed3c4509d84 100644
--- a/arch/unicore32/mm/fault.c
+++ b/arch/unicore32/mm/fault.c
@@ -278,6 +278,13 @@ retry:
278 (VM_FAULT_ERROR | VM_FAULT_BADMAP | VM_FAULT_BADACCESS)))) 278 (VM_FAULT_ERROR | VM_FAULT_BADMAP | VM_FAULT_BADACCESS))))
279 return 0; 279 return 0;
280 280
281 /*
282 * If we are in kernel mode at this point, we
283 * have no context to handle this fault with.
284 */
285 if (!user_mode(regs))
286 goto no_context;
287
281 if (fault & VM_FAULT_OOM) { 288 if (fault & VM_FAULT_OOM) {
282 /* 289 /*
283 * We ran out of memory, call the OOM killer, and return to 290 * We ran out of memory, call the OOM killer, and return to
@@ -288,13 +295,6 @@ retry:
288 return 0; 295 return 0;
289 } 296 }
290 297
291 /*
292 * If we are in kernel mode at this point, we
293 * have no context to handle this fault with.
294 */
295 if (!user_mode(regs))
296 goto no_context;
297
298 if (fault & VM_FAULT_SIGBUS) { 298 if (fault & VM_FAULT_SIGBUS) {
299 /* 299 /*
300 * We had some memory, but were unable to 300 * We had some memory, but were unable to