aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/fault.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-07-19 14:49:44 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2017-08-03 16:06:51 +1000
commitf43bb27ebf27ee3f90a42a08b86314d0239c30e4 (patch)
treefe051faddef222be810a71eb944f87f65524de43 /arch/powerpc/mm/fault.c
parentpowerpc/mm: Move page fault VMA access checks to a helper (diff)
downloadlinux-dev-f43bb27ebf27ee3f90a42a08b86314d0239c30e4.tar.xz
linux-dev-f43bb27ebf27ee3f90a42a08b86314d0239c30e4.zip
powerpc/mm: Don't lose "major" fault indication on retry
If the first iteration returns VM_FAULT_MAJOR but the second one doesn't, we fail to account the fault as a major fault. This fixes it and brings the code in line with x86. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/fault.c')
-rw-r--r--arch/powerpc/mm/fault.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index da54887a74e9..e92448469d80 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -349,7 +349,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
int is_exec = TRAP(regs) == 0x400;
int is_user = user_mode(regs);
int is_write = page_fault_is_write(error_code);
- int fault;
+ int fault, major = 0;
int store_update_sp = 0;
#ifdef CONFIG_PPC_ICSWX
@@ -501,6 +501,7 @@ good_area:
* the fault.
*/
fault = handle_mm_fault(vma, address, flags);
+ major |= fault & VM_FAULT_MAJOR;
/*
* Handle the retry right now, the mmap_sem has been released in that
@@ -534,7 +535,7 @@ good_area:
/*
* Major/minor page fault accounting.
*/
- if (fault & VM_FAULT_MAJOR) {
+ if (major) {
current->maj_flt++;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
cmo_account_page_fault();