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

mm/sparc32: 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-21-peterx@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Peter Xu and committed by
Linus Torvalds
56e10e6a 105f8862

+1 -10
+1 -10
arch/sparc/mm/fault_32.c
··· 234 234 * make sure we exit gracefully rather than endlessly redo 235 235 * the fault. 236 236 */ 237 - fault = handle_mm_fault(vma, address, flags, NULL); 237 + fault = handle_mm_fault(vma, address, flags, regs); 238 238 239 239 if (fault_signal_pending(fault, regs)) 240 240 return; ··· 250 250 } 251 251 252 252 if (flags & FAULT_FLAG_ALLOW_RETRY) { 253 - if (fault & VM_FAULT_MAJOR) { 254 - current->maj_flt++; 255 - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 256 - 1, regs, address); 257 - } else { 258 - current->min_flt++; 259 - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 260 - 1, regs, address); 261 - } 262 253 if (fault & VM_FAULT_RETRY) { 263 254 flags |= FAULT_FLAG_TRIED; 264 255