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 0F971C433E6 for ; Tue, 7 Jul 2020 22:50:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BF51520738 for ; Tue, 7 Jul 2020 22:50:49 +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="YTUVrizS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF51520738 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 163C76B00B1; Tue, 7 Jul 2020 18:50:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F8466B00B3; Tue, 7 Jul 2020 18:50:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E34766B00B4; Tue, 7 Jul 2020 18:50:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id CA0816B00B1 for ; Tue, 7 Jul 2020 18:50:40 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8EA84181AEF09 for ; Tue, 7 Jul 2020 22:50:40 +0000 (UTC) X-FDA: 77012775840.04.beef82_04163e426eb8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 696AE8006983 for ; Tue, 7 Jul 2020 22:50:40 +0000 (UTC) X-HE-Tag: beef82_04163e426eb8 X-Filterd-Recvd-Size: 5547 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 22:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594162239; 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=u4u5+MpkCsisdwspgoCKpfclb3FqsVFfOPYmJEG8Y9I=; b=YTUVrizSrDWzwQJAbzBeou3dGzF0cy4UTAHiZ0mImEqFgDq7+ShiXyJ0L4MDaBBBiNvn3Z Gdb05xs7kPvDtDB/uOMQgsLTvcoQuotFSTgs/SuH8/T5/0fulGBkTTnamBncJPZavBzXp5 3K1XG0Jszl1Yy1pJnVg4lizuojz+tIQ= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-414-aOBv6AGoOryRH5XI2bQgAg-1; Tue, 07 Jul 2020 18:50:38 -0400 X-MC-Unique: aOBv6AGoOryRH5XI2bQgAg-1 Received: by mail-qk1-f199.google.com with SMTP id o26so29626061qko.7 for ; Tue, 07 Jul 2020 15:50:37 -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=u4u5+MpkCsisdwspgoCKpfclb3FqsVFfOPYmJEG8Y9I=; b=H3mrltNNoZy9lWqVnWvwc4/L02/G6uqEIYKZDq7LEQ4Bx98q0ivMgo7jQEl46kj7Yu KbGLZnO8apPMPF1QYtxe0bo90PXrVNnrKdCJeeAiHMB/y7BceS7E3vprVTs2j5ckWgpN LUAKCoaRM1BR8Pgyrwhb1+Qayw4jZMvwOcS58razHBMQDGo2qALl3i+Vwkq2YQUFA2F3 2yFOdI5Yd5Ih8LoWvX5QDcyM2XnaL2ABCaUwNwS62C9YnRIQrLCW0wxZoYJhwY6jao7p Tvu86XzAiN6rNsQJsGJ8tfWCpH61ak93iDrBjQHCeBK1EUzalTkOAktTmgJmdPKjgQw3 p61Q== X-Gm-Message-State: AOAM531sPYdHqA7ljPz9DgTGcdO3NfcLlYlveNDVaAWdF4dkdbLtVfi8 AKwlOFce7P7JsOlJ5HbnavoBS0lHMigWdzy9Am+/mycKhFnspz8VNFqB/+5ZxoYKKncu6TlNYkI Eb2PsBcjdGZE= X-Received: by 2002:a37:b141:: with SMTP id a62mr48027924qkf.201.1594162237586; Tue, 07 Jul 2020 15:50:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCDX4X568D3uYvvAIuwtoK14UDjY6KFaGDB2k0o/5J1j74ZdyFrKj0t3T0AAWQ2lBwZRcwWw== X-Received: by 2002:a37:b141:: with SMTP id a62mr48027910qkf.201.1594162237320; Tue, 07 Jul 2020 15:50:37 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 15:50:36 -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 Subject: [PATCH v5 08/25] mm/ia64: Use general page fault accounting Date: Tue, 7 Jul 2020 18:50:04 -0400 Message-Id: <20200707225021.200906-9-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: 696AE8006983 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. 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 abf2808f9b4b..cd9766d2b6e0 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c @@ -14,6 +14,7 @@ #include #include #include +#include =20 #include #include @@ -105,6 +106,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: mmap_read_lock(mm); =20 @@ -143,7 +146,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; @@ -166,10 +169,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