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,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 8477FC433E1 for ; Fri, 26 Jun 2020 22:31:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 499B620FC3 for ; Fri, 26 Jun 2020 22:31:56 +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="P+7Ej5Od" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 499B620FC3 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 713AB6B0023; Fri, 26 Jun 2020 18:31:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 69D2E6B0024; Fri, 26 Jun 2020 18:31:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47C796B0025; Fri, 26 Jun 2020 18:31:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id 234636B0023 for ; Fri, 26 Jun 2020 18:31:49 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DF8C31EE6 for ; Fri, 26 Jun 2020 22:31:48 +0000 (UTC) X-FDA: 76972811496.23.sink34_2d069a126e59 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id B9F0837604 for ; Fri, 26 Jun 2020 22:31:48 +0000 (UTC) X-HE-Tag: sink34_2d069a126e59 X-Filterd-Recvd-Size: 5350 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Fri, 26 Jun 2020 22:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593210707; 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=YX1SShq6O2x1DHMP88Y+7d3iXwbELhsA/dlQ5QIA45o=; b=P+7Ej5Od1D6zaUueeDCy9mxzP3a+n7R08Zd4RJH0Rfg0F1WRSs/Ts7HH4z5+Qreb1LvLZe x4rIWvH2XnIYhOdIq6Fo6b9hGnCSR1U0hdstPhF2xc3UAl9g4yFC01phJAjqEtn8BbUUHN X19peuty2WO5wT9Zv9XBBwnzvUS74I0= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-335-30q1KoWuM_y8Khy7z2LaKA-1; Fri, 26 Jun 2020 18:31:46 -0400 X-MC-Unique: 30q1KoWuM_y8Khy7z2LaKA-1 Received: by mail-qv1-f72.google.com with SMTP id n10so7347429qvp.17 for ; Fri, 26 Jun 2020 15:31:46 -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=YX1SShq6O2x1DHMP88Y+7d3iXwbELhsA/dlQ5QIA45o=; b=uTFkCn5Ggm7J1x9gCPTgOmPk34MyLS0qKvfPXEFa7ydunSBo2oj6GmL4CX/EHyiBcX hZL0xel6jmS/WcFY9PB9wbgt1m5FbHi1yNTIofmbSPanGVUmKPCjxFauN28NNQyTrtdJ YKJgCdFHRkP+XWU73Ilu5/NfSOvpaUukVpxhNHpqDPwzW79ZyKIA2GHAiam33EWupVGu Z84Odb5KNrUg76NGvw8lD/xi7PMPziKDK02r3d1to1joRmCc2GRZtxm1wWaG/zh2c9Np KVM7DpErG7RQrjyo3442P/OU1t1M6BeBCyBBHwH5D9Hu0CrepGBOJoFqEc0bd4yv9uTs 3qOA== X-Gm-Message-State: AOAM532lcZdjLHw2pTQG0wzHpW9efHB9bLCfKWfDrQ628IlRR1+21p3z bQ1/1aJX3FMU8TE0Km7IIHJ75v6zb/YdtW83YzPvl2q8B8uOPjvme+QyKRGQJH3gmofEKoTzJeE UPhqLmVwey+M= X-Received: by 2002:ac8:4411:: with SMTP id j17mr5108132qtn.77.1593210705222; Fri, 26 Jun 2020 15:31:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFkGXTJ4eZV6duyjmcpFzoep5P0kIWnLzx74I0i+0clJz+tNt5G8haLS+ZCSaz1vjw9yPHMA== X-Received: by 2002:ac8:4411:: with SMTP id j17mr5108110qtn.77.1593210705002; Fri, 26 Jun 2020 15:31:45 -0700 (PDT) Received: from xz-x1.redhat.com ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id f203sm9903311qke.135.2020.06.26.15.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 15:31:44 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , Linus Torvalds , Gerald Schaefer , Andrea Arcangeli , Will Deacon , peterx@redhat.com, Michael Ellerman Subject: [PATCH 08/26] mm/ia64: Use general page fault accounting Date: Fri, 26 Jun 2020 18:31:12 -0400 Message-Id: <20200626223130.199227-9-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200626223130.199227-1-peterx@redhat.com> References: <20200626223130.199227-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B9F0837604 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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(). Signed-off-by: Peter Xu --- arch/ia64/mm/fault.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index caa93e083c9d..613255e947a8 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c @@ -14,6 +14,7 @@ #include #include #include +#include =20 #include #include @@ -101,6 +102,8 @@ ia64_do_page_fault (unsigned long address, unsigned l= ong isr, struct pt_regs *re flags |=3D FAULT_FLAG_USER; if (mask & VM_WRITE) flags |=3D FAULT_FLAG_WRITE; + + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); retry: down_read(&mm->mmap_sem); =20 @@ -139,7 +142,7 @@ ia64_do_page_fault (unsigned long address, unsigned l= ong isr, struct pt_regs *re * 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; @@ -162,10 +165,6 @@ ia64_do_page_fault (unsigned long address, unsigned = long isr, struct pt_regs *re } =20 if (flags & FAULT_FLAG_ALLOW_RETRY) { - if (fault & VM_FAULT_MAJOR) - current->maj_flt++; - else - current->min_flt++; if (fault & VM_FAULT_RETRY) { flags |=3D FAULT_FLAG_TRIED; =20 --=20 2.26.2