Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/sparc64: 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 <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David S. Miller <davem@davemloft.net>
Link: http://lkml.kernel.org/r/20200707225021.200906-22-peterx@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Peter Xu and committed by
Linus Torvalds
f08147df 56e10e6a

+1 -10
+1 -10
arch/sparc/mm/fault_64.c
··· 422 422 goto bad_area; 423 423 } 424 424 425 - fault = handle_mm_fault(vma, address, flags, NULL); 425 + fault = handle_mm_fault(vma, address, flags, regs); 426 426 427 427 if (fault_signal_pending(fault, regs)) 428 428 goto exit_exception; ··· 438 438 } 439 439 440 440 if (flags & FAULT_FLAG_ALLOW_RETRY) { 441 - if (fault & VM_FAULT_MAJOR) { 442 - current->maj_flt++; 443 - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 444 - 1, regs, address); 445 - } else { 446 - current->min_flt++; 447 - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 448 - 1, regs, address); 449 - } 450 441 if (fault & VM_FAULT_RETRY) { 451 442 flags |= FAULT_FLAG_TRIED; 452 443