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.5 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,URIBL_BLOCKED,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 469C1C433E0 for ; Tue, 7 Jul 2020 22:51:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F25B02075B for ; Tue, 7 Jul 2020 22:51:14 +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="dJBA4k6o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F25B02075B 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 B9FDA6B00C8; Tue, 7 Jul 2020 18:51:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B04756B00CB; Tue, 7 Jul 2020 18:51:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DEC66B00CC; Tue, 7 Jul 2020 18:51:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id 6F6A46B00C8 for ; Tue, 7 Jul 2020 18:51:02 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 380DE8248D52 for ; Tue, 7 Jul 2020 22:51:02 +0000 (UTC) X-FDA: 77012776764.17.help51_0b0941926eb8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 10655180D0181 for ; Tue, 7 Jul 2020 22:51:02 +0000 (UTC) X-HE-Tag: help51_0b0941926eb8 X-Filterd-Recvd-Size: 5292 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 22:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594162261; 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=goLnSgg43tg59jYNEWM6oaQtVeQ81wyjekL4b1iRhCw=; b=dJBA4k6oMiYtfRR4S+px6s3Ig8U2bTiS/pteC0zwRJTjIdv7GAMNOB/FBPpEsnQLlVALHs OCaD6qZaPfE/jO29gHy/Hz8GHef33QUflJ7M2nt3PzD7UwLlfmZqSZTfOLf6qeTlqZQu7/ clhunGngxCmFp+NY526ZkxmisjubCYY= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-198-KQ5-NrNSO0qR5r8ELs0O6g-1; Tue, 07 Jul 2020 18:50:57 -0400 X-MC-Unique: KQ5-NrNSO0qR5r8ELs0O6g-1 Received: by mail-qt1-f198.google.com with SMTP id i5so31876868qtw.3 for ; Tue, 07 Jul 2020 15:50:57 -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=goLnSgg43tg59jYNEWM6oaQtVeQ81wyjekL4b1iRhCw=; b=rpGKI6TiZ3rP0GwZw8/sHdKmkpjoNkbMJ1C3JnWVXnBJquMp6mCucRu6ufLsMKfez4 20tckq3y030oWXguOTvssqWWygtNN/vX+rfpf4g8/PjSV99lHi0GDlb11478uR2OktHy heEFK0VQ0OcnWIMTg49WlUX7k23RQtMww39FjP/g6EJKGqp31amOlMd9FYwi73jOQxll GUP/eWbTPgoHyNnBc2fJdE2fjwDhrfzuMUk95Ymn914yvoIgbIG+p+a0YEr6aL9tDv5H 8fw4lZL2rnxkfWc0i1/NYfQkSlmKt6KLOkgryNBoE7Xhy3ArE53TEX0miKt55wY6BQsP /1tA== X-Gm-Message-State: AOAM530XCE73hhUBzuoLCrqdB+uM7KwkUXdOVPiP8a72oZo3kLoOfEqI KlyoaC2bq8ZO7wZJ13AxfpHRoNlHjH4KI/Zz/R1YmbIz0V6NLEzqeJxShNtO0aJXiQJxFA010iL eVWOJcoSBm9Y= X-Received: by 2002:a37:c246:: with SMTP id j6mr51752085qkm.444.1594162257356; Tue, 07 Jul 2020 15:50:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/jy6TEpSsbY6d9HXsHHh/wU6lHsQhKJI3A8F2vFrC2VOLnGIMx4NbmWJ0GFeoTMgVhdK5UA== X-Received: by 2002:a37:c246:: with SMTP id j6mr51752065qkm.444.1594162257119; Tue, 07 Jul 2020 15:50:57 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 15:50:56 -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 , "David S . Miller" , sparclinux@vger.kernel.org Subject: [PATCH v5 20/25] mm/sparc32: Use general page fault accounting Date: Tue, 7 Jul 2020 18:50:16 -0400 Message-Id: <20200707225021.200906-21-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: 10655180D0181 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: David S. Miller CC: sparclinux@vger.kernel.org Acked-by: David S. Miller Signed-off-by: Peter Xu --- arch/sparc/mm/fault_32.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c index 06af03db4417..8071bfd72349 100644 --- a/arch/sparc/mm/fault_32.c +++ b/arch/sparc/mm/fault_32.c @@ -234,7 +234,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, = int text_fault, int write, * 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); =20 if (fault_signal_pending(fault, regs)) return; @@ -250,15 +250,6 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs,= int text_fault, int write, } =20 if (flags & FAULT_FLAG_ALLOW_RETRY) { - if (fault & VM_FAULT_MAJOR) { - current->maj_flt++; - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, - 1, regs, address); - } else { - current->min_flt++; - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, - 1, regs, address); - } if (fault & VM_FAULT_RETRY) { flags |=3D FAULT_FLAG_TRIED; =20 --=20 2.26.2