Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp271490ybt; Tue, 7 Jul 2020 22:51:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2Z5y8G3Ib40LLXgM7nn7kuwi9NRLcjMhDJAeNmva/hf183M4XMfyisZvbd7Z0Yk/a2t+J X-Received: by 2002:aa7:d4c1:: with SMTP id t1mr57265323edr.253.1594187518829; Tue, 07 Jul 2020 22:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594187518; cv=none; d=google.com; s=arc-20160816; b=JFdojNohAzcrfe71g+v+0rybX56Kub8tiFnC9i8aTERhnMJfnpGc66ZvgE7nbEx4Uo c7r1d9GjkQNNwAJ4lkDF238Au87vcDnyK5DSPxY78SJG9wA/DMlE4/Ky/LfEvRl0tvVd UBVvvlkC+6992fcEQ4qlAK4w6iedurPHtosQ4P0gvh2ovmllbHj8f+YGqR9FXutaizMT iaoQgqWpLTnP30Omu44Mi4NowPVFijoVygXCKWvJGUzyupStG0AnWuTROhSp7IFWvRY0 XX40WMr42VnTF7Te/HjF7f4+hkPOcMb4MPTYZ/yHOT8f3J2rrPuCyH4YFEbw7YX+mXmt DWTg== 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=rswUwlHni3Qk63H+jNHNoEN2HJe7/j6LV7TwoUM7hoE=; b=qbu0Nct4EbDPpQPp6lD/IiiWP0x1y34EY7wS66hbFfhc3Lf/cYEFT8DN38NX/kQj98 UXHjtC4Wz8DeIq+LbC7/bPefR5oNpiPLYUYr2ug8O18PztHskh2H0pXY9HaajxQiXPpV qlC1cFDcqQTWteL9evgZn+y9/dqGDeMNq3Jdc/L9wM1SLcG1A9KuSpAwq3yBxPX0Ols+ JoBeCTLFtn89oDrXxP2QXw3JuSv/qaOCLgxNWY0rJNuWJ8m9l2q/OX+wC2D4MZEfmQHK 3jH9dH0JRd+opufBGWBz6qizsnpucS/z/h3S/K/E7HuT7hMk4dLFv7niZhuXlEGsMqdv lAiQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r29si18282014edi.165.2020.07.07.22.51.35; Tue, 07 Jul 2020 22:51:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729634AbgGHFuF (ORCPT + 99 others); Wed, 8 Jul 2020 01:50:05 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:30084 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725794AbgGHFuE (ORCPT ); Wed, 8 Jul 2020 01:50:04 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0685aQW6082438; Wed, 8 Jul 2020 01:49:55 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3257x1geev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 01:49:55 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0685ntZn114548; Wed, 8 Jul 2020 01:49:55 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 3257x1geec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 01:49:55 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0685kxZi001206; Wed, 8 Jul 2020 05:49:53 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04ams.nl.ibm.com with ESMTP id 322hd7v64d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 05:49:53 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0685npIJ9372054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Jul 2020 05:49:51 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5C10A4060; Wed, 8 Jul 2020 05:49:50 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53456A405B; Wed, 8 Jul 2020 05:49:49 +0000 (GMT) Received: from oc3871087118.ibm.com (unknown [9.145.67.194]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 8 Jul 2020 05:49:49 +0000 (GMT) Date: Wed, 8 Jul 2020 07:49:47 +0200 From: Alexander Gordeev To: Peter Xu 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: <20200708054947.GA4026@oc3871087118.ibm.com> References: <20200707225021.200906-1-peterx@redhat.com> <20200707225021.200906-19-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707225021.200906-19-peterx@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-08_01:2020-07-08,2020-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 bulkscore=0 spamscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1011 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007080033 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.. > - 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) { > if (IS_ENABLED(CONFIG_PGSTE) && gmap && > (flags & FAULT_FLAG_RETRY_NOWAIT)) { > -- > 2.26.2 >