lkml.org 
[lkml]   [2020]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 16/25] mm/parisc: Use mm_fault_accounting()
    Date
    Use the new mm_fault_accounting() helper for page fault accounting.

    Avoid doing page fault accounting multiple times if the page fault is retried.
    Also, the perf events for page faults will be accounted too when the config has
    CONFIG_PERF_EVENTS defined.

    CC: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
    CC: Helge Deller <deller@gmx.de>
    CC: linux-parisc@vger.kernel.org
    Signed-off-by: Peter Xu <peterx@redhat.com>
    ---
    arch/parisc/mm/fault.c | 8 +++-----
    1 file changed, 3 insertions(+), 5 deletions(-)

    diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
    index 86e8c848f3d7..eab1ee8d18c6 100644
    --- a/arch/parisc/mm/fault.c
    +++ b/arch/parisc/mm/fault.c
    @@ -263,7 +263,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
    struct task_struct *tsk;
    struct mm_struct *mm;
    unsigned long acc_type;
    - vm_fault_t fault = 0;
    + vm_fault_t fault = 0, major = 0;
    unsigned int flags;

    if (faulthandler_disabled())
    @@ -303,6 +303,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
    */

    fault = handle_mm_fault(vma, address, flags);
    + major |= fault & VM_FAULT_MAJOR;

    if (fault_signal_pending(fault, regs))
    return;
    @@ -323,10 +324,6 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
    BUG();
    }
    if (flags & FAULT_FLAG_ALLOW_RETRY) {
    - if (fault & VM_FAULT_MAJOR)
    - current->maj_flt++;
    - else
    - current->min_flt++;
    if (fault & VM_FAULT_RETRY) {
    /*
    * No need to up_read(&mm->mmap_sem) as we would
    @@ -338,6 +335,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
    }
    }
    up_read(&mm->mmap_sem);
    + mm_fault_accounting(current, regs, address, major);
    return;

    check_expansion:
    --
    2.26.2
    \
     
     \ /
      Last update: 2020-06-16 00:17    [W:4.068 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site