Skip to content

Commit 428fdc0

Browse files
xzpetertorvalds
authored andcommitted
mm/powerpc: use general page fault accounting
Use the general page fault accounting by passing regs into handle_mm_fault(). Signed-off-by: Peter Xu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Michael Ellerman <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent af8a792 commit 428fdc0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

arch/powerpc/mm/fault.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
511511
* make sure we exit gracefully rather than endlessly redo
512512
* the fault.
513513
*/
514-
fault = handle_mm_fault(vma, address, flags, NULL);
514+
fault = handle_mm_fault(vma, address, flags, regs);
515515

516516
major |= fault & VM_FAULT_MAJOR;
517517

@@ -537,14 +537,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
537537
/*
538538
* Major/minor page fault accounting.
539539
*/
540-
if (major) {
541-
current->maj_flt++;
542-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
540+
if (major)
543541
cmo_account_page_fault();
544-
} else {
545-
current->min_flt++;
546-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);
547-
}
542+
548543
return 0;
549544
}
550545
NOKPROBE_SYMBOL(__do_page_fault);

0 commit comments

Comments
 (0)