Messages in this thread Patch in this message | | | From | Peter Xu <> | Subject | [PATCH 24/25] mm/x86: Use mm_fault_accounting() | Date | Mon, 15 Jun 2020 18:23:24 -0400 |
| |
Use the new mm_fault_accounting() helper for page fault accounting.
CC: Dave Hansen <dave.hansen@linux.intel.com> CC: Andy Lutomirski <luto@kernel.org> CC: Peter Zijlstra <peterz@infradead.org> CC: Thomas Gleixner <tglx@linutronix.de> CC: Ingo Molnar <mingo@redhat.com> CC: Borislav Petkov <bp@alien8.de> CC: x86@kernel.org CC: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Peter Xu <peterx@redhat.com> --- arch/x86/mm/fault.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index a51df516b87b..28635b4e324c 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -1365,8 +1365,6 @@ void do_user_addr_fault(struct pt_regs *regs, local_irq_enable(); } - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - if (hw_error_code & X86_PF_WRITE) flags |= FAULT_FLAG_WRITE; if (hw_error_code & X86_PF_INSTR) @@ -1493,13 +1491,7 @@ void do_user_addr_fault(struct pt_regs *regs, * Major/minor page fault accounting. If any of the events * returned VM_FAULT_MAJOR, we account it as a major fault. */ - if (major) { - tsk->maj_flt++; - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address); - } else { - tsk->min_flt++; - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address); - } + mm_fault_accounting(tsk, regs, address, major); check_v8086_mode(regs, address, tsk); } -- 2.26.2
| |