Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp204728ybh; Mon, 20 Jul 2020 14:28:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIPLYorfkWTnz9lulGYDRBTJP4CMr6YCMHD0iOmtdvCNF+4r5ofRTR4UcJEWPodf6xfbfO X-Received: by 2002:a17:906:eb4b:: with SMTP id mc11mr22011186ejb.5.1595280537614; Mon, 20 Jul 2020 14:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595280537; cv=none; d=google.com; s=arc-20160816; b=vLEa7/kDJG8YeeZdqdfSl9WQeHVA3NZd6ucCkkYBpQrMhxSLOaq4BMTLL9hkxb+VmZ wv43JrYA41G3qpPYgktibN3oHwUpqu9KPgdvrLVjVWiddvu34RQ9IjA9o/zMVRQmJqrh 2d8qqvR5ClMWzWZuK662vE4etf1Er2YEaO+pvDZ36pCQDEB8fP2o0LlWm7PQyw7JR9Ri v2atnBrZhLDsB8W9YXugHJXg0LEr7kBfO36jZ5Fw5/ZJHI1B0A0qfG6cFGQq7q7pkcaU haWBqwS3JvLEqTXCxllP+5gwjyLeMb9v+04N1G9IZ+JcrwiRgDppc8f4tQOkzhJHJXC5 cd1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=e4cIFJNqgNmxIfzYCGusKZV4TwyAFl1N7cbhNXRdfy8=; b=i4Pw66DoNxDzY0qxsWb1PsD2rVuq5hPaR6PEygaSZMWWovFLF/u0op6WcLJv9v4rhm aP1c7pEahoJ4Hj2ieNUA3gopzgg97LuYYAJsGQYQmG1s0CQdt9iT9j0kyJrQAYcH5WRS D8KGUceHzx8gu7OZCcKyKkuz/H10Z8AhEQkdOIA9psa2dds7Gn7vrAz7vrZfN4jaRGc/ zZO1WOyPBcnODHZjn5yzBsUmo/WOy75Cq/4Cl/D4uvqxxBtWzyODp5eBRHy9OC1mJ4kn CIh5y5fZ4BiWehSVe2ci1aTYbd2x7bzYv6gsIEFQ/FMv6g9lCh2mcHGKB5XLg8M7RdAH vcSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si10941543ejj.498.2020.07.20.14.28.34; Mon, 20 Jul 2020 14:28:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726848AbgGTVZ0 (ORCPT + 99 others); Mon, 20 Jul 2020 17:25:26 -0400 Received: from brightrain.aerifal.cx ([216.12.86.13]:34406 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgGTVZZ (ORCPT ); Mon, 20 Jul 2020 17:25:25 -0400 Date: Mon, 20 Jul 2020 17:25:24 -0400 From: Rich Felker To: Peter Xu Cc: linux-kernel@vger.kernel.org, Gerald Schaefer , Andrew Morton , Linus Torvalds , Andrea Arcangeli , Yoshinori Sato , linux-sh@vger.kernel.org Subject: Re: [PATCH 20/25] mm/sh: Use mm_fault_accounting() Message-ID: <20200720212524.GL14669@brightrain.aerifal.cx> References: <20200615221607.7764-1-peterx@redhat.com> <20200615222306.8502-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200615222306.8502-1-peterx@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 06:23:06PM -0400, Peter Xu wrote: > Use the new mm_fault_accounting() helper for page fault accounting. > > Avoid doing page fault accounting multiple times if the page fault is retried. > > CC: Yoshinori Sato > CC: Rich Felker > CC: linux-sh@vger.kernel.org > Signed-off-by: Peter Xu > --- > arch/sh/mm/fault.c | 15 +++------------ > 1 file changed, 3 insertions(+), 12 deletions(-) > > diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c > index 5f23d7907597..06b232973488 100644 > --- a/arch/sh/mm/fault.c > +++ b/arch/sh/mm/fault.c > @@ -379,7 +379,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, > struct task_struct *tsk; > struct mm_struct *mm; > struct vm_area_struct * vma; > - vm_fault_t fault; > + vm_fault_t fault, major = 0; > unsigned int flags = FAULT_FLAG_DEFAULT; > > tsk = current; > @@ -412,8 +412,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, > if ((regs->sr & SR_IMASK) != SR_IMASK) > local_irq_enable(); > > - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); > - > /* > * If we're in an interrupt, have no user context or are running > * with pagefaults disabled then we must not take the fault: > @@ -465,21 +463,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, > * the fault. > */ > fault = handle_mm_fault(vma, address, flags); > + major |= fault & VM_FAULT_MAJOR; > > if (unlikely(fault & (VM_FAULT_RETRY | VM_FAULT_ERROR))) > if (mm_fault_error(regs, error_code, address, fault)) > return; > > if (flags & FAULT_FLAG_ALLOW_RETRY) { > - if (fault & VM_FAULT_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); > - } > if (fault & VM_FAULT_RETRY) { > flags |= FAULT_FLAG_TRIED; > > @@ -493,4 +483,5 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, > } > > up_read(&mm->mmap_sem); > + mm_fault_accounting(tsk, regs, address, major); > } > -- > 2.26.2 What's the status on the rest of this series? Do you need any action from my side (arch/sh) at this time? Rich