Skip to content

Commit 105f886

Browse files
xzpetertorvalds
authored andcommitted
mm/sh: use general page fault accounting
Use the general page fault accounting by passing regs into handle_mm_fault(). It naturally solve the issue of multiple page fault accounting when page fault retry happened. Signed-off-by: Peter Xu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Rich Felker <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 35e45f3 commit 105f886

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

arch/sh/mm/fault.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -482,22 +482,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
482482
* make sure we exit gracefully rather than endlessly redo
483483
* the fault.
484484
*/
485-
fault = handle_mm_fault(vma, address, flags, NULL);
485+
fault = handle_mm_fault(vma, address, flags, regs);
486486

487487
if (unlikely(fault & (VM_FAULT_RETRY | VM_FAULT_ERROR)))
488488
if (mm_fault_error(regs, error_code, address, fault))
489489
return;
490490

491491
if (flags & FAULT_FLAG_ALLOW_RETRY) {
492-
if (fault & VM_FAULT_MAJOR) {
493-
tsk->maj_flt++;
494-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
495-
regs, address);
496-
} else {
497-
tsk->min_flt++;
498-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
499-
regs, address);
500-
}
501492
if (fault & VM_FAULT_RETRY) {
502493
flags |= FAULT_FLAG_TRIED;
503494

0 commit comments

Comments
 (0)