From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5A11C433E4 for ; Tue, 7 Jul 2020 22:51:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A55912075B for ; Tue, 7 Jul 2020 22:51:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cJyfklN4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A55912075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F01976B00C7; Tue, 7 Jul 2020 18:50:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E397F6B00C8; Tue, 7 Jul 2020 18:50:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC83C6B00CA; Tue, 7 Jul 2020 18:50:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 8EDA96B00C8 for ; Tue, 7 Jul 2020 18:50:59 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5528B2C78 for ; Tue, 7 Jul 2020 22:50:59 +0000 (UTC) X-FDA: 77012776638.24.eggs67_5b055e126eb8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 291BE1A4A0 for ; Tue, 7 Jul 2020 22:50:59 +0000 (UTC) X-HE-Tag: eggs67_5b055e126eb8 X-Filterd-Recvd-Size: 5876 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 22:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594162258; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L3XIq9qb2B089LN9k3kMf47vSw7aFkV5Znk8amd1bbo=; b=cJyfklN4TW9gl9KbVorAfHFEOC0s/hDVj4EiPLds3lh3GJRI/QhmJ6T21ZBpBs3DzGdUnT N68IVuqYYgSdyPBSR8MCmU6cW95ZjBG5f4vWikVX+ML5+Uh0cAOoYncD1ryR9LqH1Ls1wJ pMYltqqnE/rewEdjbi2353EcamCOjnw= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-397-Bb0UoktWO36mEeGdejhMFg-1; Tue, 07 Jul 2020 18:50:54 -0400 X-MC-Unique: Bb0UoktWO36mEeGdejhMFg-1 Received: by mail-qk1-f197.google.com with SMTP id v16so19462698qka.18 for ; Tue, 07 Jul 2020 15:50:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L3XIq9qb2B089LN9k3kMf47vSw7aFkV5Znk8amd1bbo=; b=hQXeZjpXK9fEcYYziQxEYiZGKe46PfOEo4HJdesc0TeZ1yxaRgbbt3o1jILl9hBjlV X6fk6WOiMZLDzrJvBDQxZjD82SP7oKTMhywzCyFvZknoDV1Qj7CRBkztybt5nyjJDWtJ 8Xgg3HmRrJdf8kC0LxtNCCJVx+VKKAw8aNCG+z2kY0gNoxn+IezaOJHbTeBQK2i/q4XE /JaOKcR4wweyVGqnNleczqEsaMwYWNM8/khdxvZ3SMB0A7yTuIgnkQpOYlabMYYtnVNx TBQESTOC1j9Vsp5KI8AmJ1p/E7UI5qTey0WKXqabjiERJ28Dnb/AWiIwlfe5BSEHxpKq +dMA== X-Gm-Message-State: AOAM53299Jh8tu3xBmmOrH6+MpLtATFFqWl4k1bkYNnzBBzkt3yTBC0D /iadLXDCMIm8cuvZ2LPR8L4ceQvtEKqmdAymAt7mEzU5YxuTMLqVtNAXTyBHvt24WSz694okqz1 b14OcxzQMjyY= X-Received: by 2002:a37:aa05:: with SMTP id t5mr54060133qke.451.1594162254233; Tue, 07 Jul 2020 15:50:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeE2qM5GM19ugpdoKdIt+ai6du4xQwHKQ/Rb9KnI/4dISGj30ouoU1oW9Iw8yZXJini/8w8g== X-Received: by 2002:a37:aa05:: with SMTP id t5mr54060118qke.451.1594162254014; Tue, 07 Jul 2020 15:50:54 -0700 (PDT) Received: from xz-x1.redhat.com ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id j16sm26267642qtp.92.2020.07.07.15.50.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 15:50:53 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Gerald Schaefer , Linus Torvalds , peterx@redhat.com, Andrew Morton , Will Deacon , Andrea Arcangeli , David Rientjes , John Hubbard , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Subject: [PATCH v5 18/25] mm/s390: Use general page fault accounting Date: Tue, 7 Jul 2020 18:50:14 -0400 Message-Id: <20200707225021.200906-19-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200707225021.200906-1-peterx@redhat.com> References: <20200707225021.200906-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 291BE1A4A0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use the general page fault accounting by passing regs into handle_mm_faul= t(). 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 =3D handle_mm_fault(vma, address, flags, NULL); + fault =3D handle_mm_fault(vma, address, flags, regs); if (fault_signal_pending(fault, regs)) { fault =3D 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; =20 - /* - * 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) { - 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)) { --=20 2.26.2