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.8 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 792EFC433E0 for ; Tue, 30 Jun 2020 20:53:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3874420702 for ; Tue, 30 Jun 2020 20:53:25 +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="ckJbStfp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3874420702 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 C5BA76B0093; Tue, 30 Jun 2020 16:53:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C0C856B0096; Tue, 30 Jun 2020 16:53:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B225C6B0098; Tue, 30 Jun 2020 16:53:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id 9DBA86B0093 for ; Tue, 30 Jun 2020 16:53:24 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 613028248068 for ; Tue, 30 Jun 2020 20:53:24 +0000 (UTC) X-FDA: 76987078728.26.knee95_0f0f6fa26e7b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 403D41804B65C for ; Tue, 30 Jun 2020 20:53:24 +0000 (UTC) X-HE-Tag: knee95_0f0f6fa26e7b X-Filterd-Recvd-Size: 5534 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 20:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593550403; 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; bh=dSLF2JUETXiqlgMgrNmE+7rrHD1HC1gVnVSET6GUPpA=; b=ckJbStfp0nq3xNkwZbm2ZP936AA8ia+ld+rb9c5Ar+jXvWFCpYagolC27xt54V7PqWp3os 3Ad7KnURfkO7LM/Wk2Qfz9hicql0pMEXkIkEwfi1w67c1H5TwPMStdRDhLsGg9y4NM2fmp bvV/iZ1hgctXPGJQhyDrXBYPtV5A9s0= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-5NOZNn_gMeq5kVudJsuEAw-1; Tue, 30 Jun 2020 16:53:21 -0400 X-MC-Unique: 5NOZNn_gMeq5kVudJsuEAw-1 Received: by mail-io1-f70.google.com with SMTP id d64so13835113iof.12 for ; Tue, 30 Jun 2020 13:53:21 -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:mime-version :content-transfer-encoding; bh=dSLF2JUETXiqlgMgrNmE+7rrHD1HC1gVnVSET6GUPpA=; b=FFjNXtYfE+tZ4D9QSCgGWRQwRnE5c/WZlUk3AOZZhFjOgkkcbzDhfQpXdCS4hwCUHn f7nUiVIqW6VXs0eBlTaCQwh8RwWGc1uwm1gxg0g4Narc6+R+gssUTn4N2Hzv4qTxJwZt aDwx0cEMmEHaU7jWfkUmIR/lXJyLEbV/p6cz99V4/L6XVov1ErJYK/Yjy8nLyRB+JbG5 Zfz6YsWQjvnBgZVQxUTwPHIxrJ/b1gjxO0xMyWZKNj0yN8rZGXtDM1U72st+Xak7sMrN gavUNsj3/JbmFlAREZu6smCOKT7ffgopzIxsURx8z36op10IWhL0zNVJGBgPXM693UzU 9wgA== X-Gm-Message-State: AOAM532sgyx4QByoERTvv7c0Hmn4uBr7Q37zA1oB9QwQka/H1CGWSVJ8 AB3F8Ytr1Q7KieCOPs0R5i3iZRRTmayVeG2532hUCvmBHrdN78Yw9CwmvPTU6Qcrd3y/x+HI7x5 45+Wq76sR8J0= X-Received: by 2002:a02:3501:: with SMTP id k1mr24516433jaa.14.1593550400823; Tue, 30 Jun 2020 13:53:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvoEV2FUJkvA5qAwTsI4mdiDZPCkCjdD/AwbVYfXw8WHclHjXZP0TyZnfiU/sv0k2kSJZuSg== X-Received: by 2002:aed:204e:: with SMTP id 72mr22146487qta.313.1593549942977; Tue, 30 Jun 2020 13:45:42 -0700 (PDT) Received: from xz-x1.redhat.com ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id t5sm3840619qkh.46.2020.06.30.13.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 13:45:42 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , peterx@redhat.com, John Hubbard , Michael Ellerman , Gerald Schaefer , Andrea Arcangeli , Linus Torvalds , Will Deacon , "James E . J . Bottomley" , Helge Deller , linux-parisc@vger.kernel.org Subject: [PATCH v4 15/26] mm/parisc: Use general page fault accounting Date: Tue, 30 Jun 2020 16:45:40 -0400 Message-Id: <20200630204540.39197-1-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 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: 403D41804B65C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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. Add the missing PERF_COUNT_SW_PAGE_FAULTS perf events too. Note, the oth= er two perf events (PERF_COUNT_SW_PAGE_FAULTS_[MAJ|MIN]) were done in handle_mm_= fault(). CC: James E.J. Bottomley CC: Helge Deller CC: linux-parisc@vger.kernel.org Signed-off-by: Peter Xu --- arch/parisc/mm/fault.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index e32d06928c24..4bfe2da9fbe3 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -18,6 +18,7 @@ #include #include #include +#include =20 #include =20 @@ -281,6 +282,7 @@ void do_page_fault(struct pt_regs *regs, unsigned lon= g code, acc_type =3D parisc_acctyp(code, regs->iir); if (acc_type & VM_WRITE) flags |=3D FAULT_FLAG_WRITE; + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); retry: mmap_read_lock(mm); vma =3D find_vma_prev(mm, address, &prev_vma); @@ -302,7 +304,7 @@ void do_page_fault(struct pt_regs *regs, unsigned lon= g code, * fault. */ =20 - 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; @@ -323,10 +325,6 @@ void do_page_fault(struct pt_regs *regs, unsigned lo= ng code, BUG(); } if (flags & FAULT_FLAG_ALLOW_RETRY) { - if (fault & VM_FAULT_MAJOR) - current->maj_flt++; - else - current->min_flt++; if (fault & VM_FAULT_RETRY) { /* * No need to mmap_read_unlock(mm) as we would --=20 2.26.2