Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2000407ybt; Mon, 15 Jun 2020 15:25:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyneJpPUKTAN/rhIE945nuoJ44unVD9MjKD4dgjTMAxgYXij5zPdm7AjLz80/fx5IHuicnp X-Received: by 2002:a17:906:481b:: with SMTP id w27mr26988565ejq.27.1592259943582; Mon, 15 Jun 2020 15:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592259943; cv=none; d=google.com; s=arc-20160816; b=im9SB/Ovouz3GSYDK06mDkGUyr14Eb9Yw8q0eWLvf8VTYeeLJgkTQxwzMrmXwr7VzN DFByLJE+xCx0y/ppQPXgcbUh56D5A81FaXNB3W9eWmTHivok5b+2PVyn554llMMnGcEx BxTVH41vuwgrmSPEpeo8WYWr65GJMoon+20EmpM9dpu6Bi64SRoJZ+DF9RzlRkzJ44+j Pmze7UUMcjrmC3Ppk87gkHImZ0gUwCQ62GwJD9KsrrIiZRb8ufOf2gXepOPXim2Yn8cb ilWw5ICv9nduONu9YA2gOS04VZ7uZC1mr5AZyJhW4WBeZ4Bov9mPrGrjkQpyfoS7t0Z3 r1ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PArYWb352L+DXtBq06f75Fl1n2OZ3XFiT47vlDcADhg=; b=NNUXClNQHSYMcxYd4nCbOWCfY8L3T0AL7MoKpkdrSoWj3NQpHmVKHYFz9pqPa2Eq+Q lOQic1Sg027G2NcK4FD096rzI4H0B/gWTIRNxfJLaPez+xHGOSGUDU/XY3nB+EKFKAGh 8MUEvUuQ5fv2majidsHNhDCp3cBJNyu7IxJh30NBNauS/SnHuntaXeAlzBkQvrEeSMkK OtqxizhTzCQxwDeVxag4lcqzlAssPygsCGt6i3QzDCwaeC3RiTYcnNvS1pn7Z06mG9tQ Ss4mAz7EhirlfHUZXk48vWNX33mgwJKvNBwEUSGWpYPOO0kV+wEXKOzGOvBbA5jI02y3 YzWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aSM47lf1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce13si9983383edb.81.2020.06.15.15.25.22; Mon, 15 Jun 2020 15:25:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aSM47lf1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726602AbgFOWXd (ORCPT + 99 others); Mon, 15 Jun 2020 18:23:33 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:35549 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726586AbgFOWXa (ORCPT ); Mon, 15 Jun 2020 18:23:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592259809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PArYWb352L+DXtBq06f75Fl1n2OZ3XFiT47vlDcADhg=; b=aSM47lf1KfcEuK/VLXfZUUEWv/uL8YMpoGJjhSAv/nhM7W+c5tGuTLcleZqesS1qqBP8la icD6m8xCHyx4AP5pvt+NTyL8vlo0TCgkwIz+gEetcIjDAKjIqKUNGKQLMNlQiXCn4XLfpz aIH17ZofzB8SBbGML+NB8/Zk+J5WJqc= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-NiK-pjnfOWaXD0JaNFlKgw-1; Mon, 15 Jun 2020 18:23:27 -0400 X-MC-Unique: NiK-pjnfOWaXD0JaNFlKgw-1 Received: by mail-qk1-f198.google.com with SMTP id l184so15436859qkb.2 for ; Mon, 15 Jun 2020 15:23:27 -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=PArYWb352L+DXtBq06f75Fl1n2OZ3XFiT47vlDcADhg=; b=YuvhECjDLRAHATUhoIx7ajMe6FH+DK8jWI8uylIjX3yN87ovkbk9gjAJwCIBX5V5FN ZFV0RVnoQKRhhQAChQnXIC0AfNNysEZgr4jMRYZy0JkK4sbKw4CaDbtZQTqucpgy9yZD u3M6g1jto9K1Gg0f+t+ETUZLFOdwIzN314Ra7wH1K707LKdiZFltOvPhBqeSZ/BuKCtP iIAJentdTYLV8nrtk0MAo1A7a0t7981AzKPqd9PbHnrQD2KZJFmzp6GzO2xLyv6vdPVD aKCDs8azfRc7ryywAXIMjfkKc7JvH3YuYrAGxL3iHz6JTcEZ6Rjai531anKnggg/TMc0 EHyg== X-Gm-Message-State: AOAM530wHqN7TMrRzgfsBr/OXzA4mvxfiFISZATAM6VSrkV9SbTWLsLR z+yNuxHK5AxZIz9PCv0I9A+fAevVZ6i2YbpQb/6mPwpsYTcqfpAteTepLxfvWhrZcuTUIhlhA6+ xQ4WMgBjsEsf9lWTxyXYPn1vP X-Received: by 2002:a37:a8c4:: with SMTP id r187mr17219548qke.69.1592259806899; Mon, 15 Jun 2020 15:23:26 -0700 (PDT) X-Received: by 2002:a37:a8c4:: with SMTP id r187mr17219521qke.69.1592259806700; Mon, 15 Jun 2020 15:23:26 -0700 (PDT) Received: from xz-x1.hitronhub.home ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id i3sm11867984qkf.39.2020.06.15.15.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 15:23:26 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org Cc: Peter Xu , Gerald Schaefer , Andrew Morton , Linus Torvalds , Andrea Arcangeli , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" Subject: [PATCH 24/25] mm/x86: Use mm_fault_accounting() Date: Mon, 15 Jun 2020 18:23:24 -0400 Message-Id: <20200615222324.8697-1-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200615221607.7764-1-peterx@redhat.com> References: <20200615221607.7764-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the new mm_fault_accounting() helper for page fault accounting. CC: Dave Hansen CC: Andy Lutomirski CC: Peter Zijlstra CC: Thomas Gleixner CC: Ingo Molnar CC: Borislav Petkov CC: x86@kernel.org CC: H. Peter Anvin Signed-off-by: Peter Xu --- arch/x86/mm/fault.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index a51df516b87b..28635b4e324c 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -1365,8 +1365,6 @@ void do_user_addr_fault(struct pt_regs *regs, local_irq_enable(); } - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - if (hw_error_code & X86_PF_WRITE) flags |= FAULT_FLAG_WRITE; if (hw_error_code & X86_PF_INSTR) @@ -1493,13 +1491,7 @@ void do_user_addr_fault(struct pt_regs *regs, * Major/minor page fault accounting. If any of the events * returned VM_FAULT_MAJOR, we account it as a major fault. */ - if (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); - } + mm_fault_accounting(tsk, regs, address, major); check_v8086_mode(regs, address, tsk); } -- 2.26.2