summaryrefslogtreecommitdiff
path: root/arch/nds32/mm/fault.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2020-07-20 18:29:44 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2020-07-20 18:29:44 +1000
commit61c2dbfd4f3fb10e574f8779763900afb6d60ac6 (patch)
treeba3c722c12bb3726f6fc9587c4dea8c55642633c /arch/nds32/mm/fault.c
parent9dfa5c1dcba0b1e2f06cbc3061d3e1ae5feaea15 (diff)
parentd3a0b365954e5e4728b6a92b171e4659199c6db5 (diff)
downloadlinux-next-61c2dbfd4f3fb10e574f8779763900afb6d60ac6.tar.gz
Merge branch 'akpm/master'
Diffstat (limited to 'arch/nds32/mm/fault.c')
-rw-r--r--arch/nds32/mm/fault.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/nds32/mm/fault.c b/arch/nds32/mm/fault.c
index 8fb73f6401a0..f02524eb6d56 100644
--- a/arch/nds32/mm/fault.c
+++ b/arch/nds32/mm/fault.c
@@ -121,6 +121,8 @@ void do_page_fault(unsigned long entry, unsigned long addr,
if (unlikely(faulthandler_disabled() || !mm))
goto no_context;
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
+
/*
* As per x86, we may deadlock here. However, since the kernel only
* validly references user space from well defined areas of the code,
@@ -206,7 +208,7 @@ good_area:
* the fault.
*/
- fault = handle_mm_fault(vma, addr, flags);
+ fault = handle_mm_fault(vma, addr, flags, regs);
/*
* If we need to retry but a fatal signal is pending, handle the
@@ -228,22 +230,7 @@ good_area:
goto bad_area;
}
- /*
- * Major/minor page fault accounting is only done on the initial
- * attempt. If we go through a retry, it is extremely likely that the
- * page will be found in page cache at that point.
- */
- perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
if (flags & FAULT_FLAG_ALLOW_RETRY) {
- if (fault & VM_FAULT_MAJOR) {
- tsk->maj_flt++;
- perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ,
- 1, regs, addr);
- } else {
- tsk->min_flt++;
- perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN,
- 1, regs, addr);
- }
if (fault & VM_FAULT_RETRY) {
flags |= FAULT_FLAG_TRIED;