Commit 428fdc09 authored by Peter Xu's avatar Peter Xu Committed by Linus Torvalds

mm/powerpc: use general page fault accounting

Use the general page fault accounting by passing regs into
handle_mm_fault().
Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Link: http://lkml.kernel.org/r/20200707225021.200906-17-peterx@redhat.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent af8a7926
...@@ -511,7 +511,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -511,7 +511,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
* make sure we exit gracefully rather than endlessly redo * make sure we exit gracefully rather than endlessly redo
* the fault. * the fault.
*/ */
fault = handle_mm_fault(vma, address, flags, NULL); fault = handle_mm_fault(vma, address, flags, regs);
major |= fault & VM_FAULT_MAJOR; major |= fault & VM_FAULT_MAJOR;
...@@ -537,14 +537,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -537,14 +537,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
/* /*
* Major/minor page fault accounting. * Major/minor page fault accounting.
*/ */
if (major) { if (major)
current->maj_flt++;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
cmo_account_page_fault(); cmo_account_page_fault();
} else {
current->min_flt++;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);
}
return 0; return 0;
} }
NOKPROBE_SYMBOL(__do_page_fault); NOKPROBE_SYMBOL(__do_page_fault);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment