diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2013-09-12 15:13:39 -0700 |
---|---|---|
committer | Ishan Mittal <imittal@nvidia.com> | 2014-04-30 11:39:04 +0530 |
commit | 1cc77bf41fbcbbad6d5899e2ba4d355ea93c444e (patch) | |
tree | ec8c57d80d5583a146acbb3ad4ac6d0a9c701766 /arch/arc | |
parent | b05a09e710b9e51ddb88d230ca1cca02484c1034 (diff) |
arch: mm: pass userspace fault flag to generic fault handler
Unlike global OOM handling, memory cgroup code will invoke the OOM killer
in any OOM situation because it has no way of telling faults occuring in
kernel context - which could be handled more gracefully - from
user-triggered faults.
Pass a flag that identifies faults originating in user space from the
architecture-specific fault handlers to generic code so that memcg OOM
handling can be improved.
(cherry picked from commit 759496ba6407c6994d6a5ce3a5e74937d7816208)
Conflicts:
arch/arc/mm/fault.c
Change-Id: I6ddf37c0feae69fcda0c2db76d2b10ca2a11c619
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: azurIt <azurit@pobox.sk>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/mm/fault.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index 7c10770782a1..028e11e69e68 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c @@ -59,6 +59,7 @@ void do_page_fault(struct pt_regs *regs, int write, unsigned long address, struct mm_struct *mm = tsk->mm; siginfo_t info; int fault, ret; + int write = regs->ecr_cause & ECR_C_PROTV_STORE; /* ST/EX */ unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; /* |