Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp607677ybt; Wed, 8 Jul 2020 07:32:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVC2lmPaRXsORWoRZqITo6CtyNpp9OgGtzr4O9ooXJmNypKYfpfxiJJHZxll0lI7QNstKg X-Received: by 2002:aa7:cfc4:: with SMTP id r4mr32439373edy.22.1594218744750; Wed, 08 Jul 2020 07:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594218744; cv=none; d=google.com; s=arc-20160816; b=jgViSwnM3TGx8o8XWvmfWQ1Tf1GxESmWOOLubGGNFkhBIYi7cvBsDSDzo8GohcoRVZ 4E+GaAU5kHXn1m5y2eopoq0XwACplNujyolM0z2WX9kjPAZydVrpv0O/B/iu9vhuF+nC AxfiW7Azw9YIe+m4rFl5QRK6f0NvlTrBq8AKGj87seXQqCdgy5Z/FQdyESx++1bRkOQx EczgKlSA9wKywn2uG3U4m17s/v0xZLpXNLkrsFVO9f6DbldDCWqGTpH/yXcCJdzIzvfa pO/eMUhJSmXpQdNaO+y318ZmkfrXfwzX/YUo3fycN0l9ZPm1ujvopNDAOrmvYvlrN5WZ ZC/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=rKC2bx14eHyjb/gYKwLehiBR3K2qmjX+EfAM9GW8MbE=; b=SUt4/YVVr7sj6cxVBxZbTeySkc0j6+eXiOgTnFfOmG/Dyq2aZkHIhBCUWDK+1Tp3WA UK4W/roAkTeKvcEV0f/vpNtFMRdU+Fj/bXN4gepphh6/nPeHX7SCeJC8IBhumJ2Biv5c bnTSrgTBV0q1ib3yUhdlcaVWkW1xmIHPnvqxB68FnMce/wEruojVZGrHJcdKtOUYI1dZ ZN46aBfpSJ+aX53QX5pjT7WGH+Sy9E2MlYvsEc9L+lSTUsDfp56njhatloTkdg+UQBEV EXJIm6GjmtXqxIPpHYmFtbbNcLqJ5UVKi1Ku/fOUqWkmsZqkLmdbOjyXHZGM5tRNKAw3 R1Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z109u7dx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d14si94531edp.98.2020.07.08.07.32.01; Wed, 08 Jul 2020 07:32:24 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z109u7dx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729699AbgGHObF (ORCPT + 99 others); Wed, 8 Jul 2020 10:31:05 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:53731 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729635AbgGHObD (ORCPT ); Wed, 8 Jul 2020 10:31:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594218661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rKC2bx14eHyjb/gYKwLehiBR3K2qmjX+EfAM9GW8MbE=; b=Z109u7dxUxr93Wk8jPEuNCQtOEuYSqj0yFXLAUd9n/auKhSrp/Kln29B0PKriL47FV0kPI b9a3orzOqTov6KVQUyN8RIPxCuxB06X1k3WEsvnTJPNM9S70E0wXXMaRO+7XgHSEbeKoe1 JrZk/sixfvEbV7zwtnaVfZVI0nQ/2XU= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-151-anRVKBTKPpaKUzstI5DsAQ-1; Wed, 08 Jul 2020 10:31:00 -0400 X-MC-Unique: anRVKBTKPpaKUzstI5DsAQ-1 Received: by mail-qt1-f200.google.com with SMTP id 94so32866618qtb.21 for ; Wed, 08 Jul 2020 07:30:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rKC2bx14eHyjb/gYKwLehiBR3K2qmjX+EfAM9GW8MbE=; b=jNNywCaImzKpscRzsUxaH/P4jDAE457OooU/uGXBi5rMuQqjj6oL2iKejb/KVaSAqE QjvOowSQbwTv7ZiYNHJXySP2yDJK1+c0zwiCSJq0JyPqrhTFhBzBEtGGIh94XihGUhd1 QvuV0BfrZFNNARkeNjIjPSFXZgB8MVfVT5MFt8lwjrv0Q8b9qI0xLwo0QzSrx3mbBUwo OfxgxDqdRMZxSdJGwuPtt/UJoUtt4r+jtk1qE8T+fn5BDSdSLMZn+fGzCjcYhVrWCWgP eqERgDEt98Cx4Mpf1T8pX5Mi4Oj+oGegOzykcoOyYqJNE3UlouVHIba24K+dRx1AsXzI CmAw== X-Gm-Message-State: AOAM533hTCyDVYQwyS27P9rVxE4j1QQlhZLiqCXxU4Hn4ZeShbY0EAEL K9qAY9gRAHbnfA36Hrm1zkp1uJJIPI1+gE7xel23oh07BFJln8EAJxzwEiclQiyzcGi7doj8sGO llz7oICy+lSUXd6vr32AToSzp X-Received: by 2002:ac8:1c09:: with SMTP id a9mr60809774qtk.64.1594218658618; Wed, 08 Jul 2020 07:30:58 -0700 (PDT) X-Received: by 2002:ac8:1c09:: with SMTP id a9mr60809747qtk.64.1594218658367; Wed, 08 Jul 2020 07:30:58 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c8:6f::1f4f]) by smtp.gmail.com with ESMTPSA id k18sm25951849qki.30.2020.07.08.07.30.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 07:30:57 -0700 (PDT) Date: Wed, 8 Jul 2020 10:30:54 -0400 From: Peter Xu To: Alexander Gordeev Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Gerald Schaefer , Linus Torvalds , Andrew Morton , Will Deacon , Andrea Arcangeli , David Rientjes , John Hubbard , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Subject: Re: [PATCH v5 18/25] mm/s390: Use general page fault accounting Message-ID: <20200708143054.GB199122@xz-x1> References: <20200707225021.200906-1-peterx@redhat.com> <20200707225021.200906-19-peterx@redhat.com> <20200708054947.GA4026@oc3871087118.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200708054947.GA4026@oc3871087118.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 08, 2020 at 07:49:47AM +0200, Alexander Gordeev wrote: > On Tue, Jul 07, 2020 at 06:50:14PM -0400, Peter Xu wrote: > > 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. > > > > CC: Heiko Carstens > > CC: Vasily Gorbik > > CC: Christian Borntraeger > > CC: linux-s390@vger.kernel.org > > Reviewed-by: Gerald Schaefer > > Acked-by: Gerald Schaefer > > Signed-off-by: Peter Xu > > --- > > arch/s390/mm/fault.c | 16 +--------------- > > 1 file changed, 1 insertion(+), 15 deletions(-) > > > > diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c > > index fc14df0b4d6e..9aa201df2e94 100644 > > --- a/arch/s390/mm/fault.c > > +++ b/arch/s390/mm/fault.c > > @@ -478,7 +478,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access) > > * make sure we exit gracefully rather than endlessly redo > > * the fault. > > */ > > - fault = handle_mm_fault(vma, address, flags, NULL); > > + fault = handle_mm_fault(vma, address, flags, regs); > > if (fault_signal_pending(fault, regs)) { > > fault = VM_FAULT_SIGNAL; > > if (flags & FAULT_FLAG_RETRY_NOWAIT) > > @@ -488,21 +488,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access) > > if (unlikely(fault & VM_FAULT_ERROR)) > > goto out_up; > > > > - /* > > - * Major/minor page fault accounting is only done on the > > - * initial attempt. If we go through a retry, it is extremely > > - * likely that the page will be found in page cache at that point. > > - */ > > if (flags & FAULT_FLAG_ALLOW_RETRY) { > > Shouldn't this check ^^^ be dropped as well? > > Since commit 4064b9827063 ("mm: allow VM_FAULT_RETRY for multiple times") > FAULT_FLAG_ALLOW_RETRY never gets unset, so no need to check.. I agree, but it should be out of the scope of the accounting changes that this patch wants to address. Maybe more suitable for a work on top? This should also exist for most of the archs too, and I'm also not sure whether compiler could be smart enough to optimize this directly since it seems to have all the knowledge. Thanks, -- Peter Xu