diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-12 18:44:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-12 18:44:27 -0400 |
commit | ac4de9543aca59f2b763746647577302fbedd57e (patch) | |
tree | 40407750569ee030de56233c41c9a97f7e89cf67 /arch/arc | |
parent | 26935fb06ee88f1188789807687c03041f3c70d9 (diff) | |
parent | de32a8177f64bc62e1b19c685dd391af664ab13f (diff) |
Merge branch 'akpm' (patches from Andrew Morton)
Merge more patches from Andrew Morton:
"The rest of MM. Plus one misc cleanup"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (35 commits)
mm/Kconfig: add MMU dependency for MIGRATION.
kernel: replace strict_strto*() with kstrto*()
mm, thp: count thp_fault_fallback anytime thp fault fails
thp: consolidate code between handle_mm_fault() and do_huge_pmd_anonymous_page()
thp: do_huge_pmd_anonymous_page() cleanup
thp: move maybe_pmd_mkwrite() out of mk_huge_pmd()
mm: cleanup add_to_page_cache_locked()
thp: account anon transparent huge pages into NR_ANON_PAGES
truncate: drop 'oldsize' truncate_pagecache() parameter
mm: make lru_add_drain_all() selective
memcg: document cgroup dirty/writeback memory statistics
memcg: add per cgroup writeback pages accounting
memcg: check for proper lock held in mem_cgroup_update_page_stat
memcg: remove MEMCG_NR_FILE_MAPPED
memcg: reduce function dereference
memcg: avoid overflow caused by PAGE_ALIGN
memcg: rename RESOURCE_MAX to RES_COUNTER_MAX
memcg: correct RESOURCE_MAX to ULLONG_MAX
mm: memcg: do not trap chargers with full callstack on OOM
mm: memcg: rework and document OOM waiting and wakeup
...
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/mm/fault.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index 0fd1f0d515ff..d63f3de0cd5b 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c | |||
@@ -60,8 +60,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address) | |||
60 | siginfo_t info; | 60 | siginfo_t info; |
61 | int fault, ret; | 61 | int fault, ret; |
62 | int write = regs->ecr_cause & ECR_C_PROTV_STORE; /* ST/EX */ | 62 | int write = regs->ecr_cause & ECR_C_PROTV_STORE; /* ST/EX */ |
63 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | | 63 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; |
64 | (write ? FAULT_FLAG_WRITE : 0); | ||
65 | 64 | ||
66 | /* | 65 | /* |
67 | * We fault-in kernel-space virtual memory on-demand. The | 66 | * We fault-in kernel-space virtual memory on-demand. The |
@@ -89,6 +88,8 @@ void do_page_fault(struct pt_regs *regs, unsigned long address) | |||
89 | if (in_atomic() || !mm) | 88 | if (in_atomic() || !mm) |
90 | goto no_context; | 89 | goto no_context; |
91 | 90 | ||
91 | if (user_mode(regs)) | ||
92 | flags |= FAULT_FLAG_USER; | ||
92 | retry: | 93 | retry: |
93 | down_read(&mm->mmap_sem); | 94 | down_read(&mm->mmap_sem); |
94 | vma = find_vma(mm, address); | 95 | vma = find_vma(mm, address); |
@@ -117,12 +118,12 @@ good_area: | |||
117 | if (write) { | 118 | if (write) { |
118 | if (!(vma->vm_flags & VM_WRITE)) | 119 | if (!(vma->vm_flags & VM_WRITE)) |
119 | goto bad_area; | 120 | goto bad_area; |
121 | flags |= FAULT_FLAG_WRITE; | ||
120 | } else { | 122 | } else { |
121 | if (!(vma->vm_flags & (VM_READ | VM_EXEC))) | 123 | if (!(vma->vm_flags & (VM_READ | VM_EXEC))) |
122 | goto bad_area; | 124 | goto bad_area; |
123 | } | 125 | } |
124 | 126 | ||
125 | survive: | ||
126 | /* | 127 | /* |
127 | * If for any reason at all we couldn't handle the fault, | 128 | * If for any reason at all we couldn't handle the fault, |
128 | * make sure we exit gracefully rather than endlessly redo | 129 | * make sure we exit gracefully rather than endlessly redo |
@@ -201,10 +202,6 @@ no_context: | |||
201 | die("Oops", regs, address); | 202 | die("Oops", regs, address); |
202 | 203 | ||
203 | out_of_memory: | 204 | out_of_memory: |
204 | if (is_global_init(tsk)) { | ||
205 | yield(); | ||
206 | goto survive; | ||
207 | } | ||
208 | up_read(&mm->mmap_sem); | 205 | up_read(&mm->mmap_sem); |
209 | 206 | ||
210 | if (user_mode(regs)) { | 207 | if (user_mode(regs)) { |