Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4719932imu; Tue, 8 Jan 2019 05:15:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN7H3tjXbd2N5TwtN3AsLkGUmD8QIkMGtZ255EFaAKre0AvVEUESSsliOlsk+xe5jf7tAbxQ X-Received: by 2002:a17:902:bd0a:: with SMTP id p10mr1681585pls.322.1546953305210; Tue, 08 Jan 2019 05:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546953305; cv=none; d=google.com; s=arc-20160816; b=dk/0M4QebDJj6RG8WaCK0nhcQFBKjDZbrB4Le8M6jvTygtc/6402ppjZpIOiyaoGxN SzkAL68U6w57fuO32XziIaon37QVrl4WPQM+hy3p04hJwaVKqPqHIv7/C7lTei/LQnpP tqpvKfpeNFKtv5MVubdXZqNy8HrhxsSyEwfUo4h7+qNGPY1g5k81i3Co1ja8Cs6Jm4qc UONXEek0ZchDzmi1+6YJ55TKHjF2ijgPeNyQRDX8pPyAswCgnKB22vy/hk8Mn472luEE yG7kx4SvllCnV4Vscsg5DlItT1xmdKcGBE0HGwJR0S2Nb4oVkCvwCtJpKMKpJCU+q4Zq Uhlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mgvrRQgdrNJ2yFOWGLBw9T4XESsrYUD43a67xXxbk7w=; b=E37c1pno3sdm/mHap80DVO64eC+3kO2yqeYXdZ50BmefvYWXElWY4IHpNAYQWEjUr2 ILhqMPVj6nLyT17pR2Ug0K+yFmy+CSHqDGjeTtxEByELuTJZKlOoDATjvE0OWF7uP8z4 sbQcDMNrVpACg0guwmswJxRdgq0Irer+5VSJShjAZJgLXugqfwmGbXU7pMiqBsLT83K2 9CETNios61hiML/SYkUdMSCGX0XifOzSbl2V3hToWpKGJ2GJERuZfZaCpKzvtIq7s/T0 JW5PXJDQi0IosWVsHgDR7zatv2Txw2fYtnKSPqwTeGipMz9vC1bmBhdeBNTmTODM2KiY zGXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si3963802pld.282.2019.01.08.05.14.48; Tue, 08 Jan 2019 05:15:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728325AbfAHNMv (ORCPT + 99 others); Tue, 8 Jan 2019 08:12:51 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50902 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726129AbfAHNMu (ORCPT ); Tue, 8 Jan 2019 08:12:50 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02FEC1596; Tue, 8 Jan 2019 05:12:50 -0800 (PST) Received: from localhost (unknown [10.37.6.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5EF773F70D; Tue, 8 Jan 2019 05:12:49 -0800 (PST) Date: Tue, 8 Jan 2019 13:12:47 +0000 From: Andrew Murray To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Richard Henderson , Ivan Kokshaysky , Matt Turner , Will Deacon , Mark Rutland , Shawn Guo , Sascha Hauer , Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Borislav Petkov , Russell King , suzuki.poulose@arm.com, robin.murphy@arm.com, Michael Ellerman , x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com Subject: Re: [PATCH v4 10/13] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs Message-ID: <20190108131247.GE56789@e119886-lin.cambridge.arm.com> References: <1546878450-20341-1-git-send-email-andrew.murray@arm.com> <1546878450-20341-11-git-send-email-andrew.murray@arm.com> <20190108104841.GD6808@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190108104841.GD6808@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 08, 2019 at 11:48:41AM +0100, Peter Zijlstra wrote: > On Mon, Jan 07, 2019 at 04:27:27PM +0000, Andrew Murray wrote: > > For drivers that do not support context exclusion let's advertise the > > PERF_PMU_CAP_NOEXCLUDE capability. This ensures that perf will > > prevent us from handling events where any exclusion flags are set. > > Let's also remove the now unnecessary check for exclusion flags. > > > > Signed-off-by: Andrew Murray > > --- > > arch/x86/events/amd/ibs.c | 13 +------------ > > arch/x86/events/amd/power.c | 10 ++-------- > > arch/x86/events/intel/cstate.c | 12 +++--------- > > arch/x86/events/intel/rapl.c | 9 ++------- > > arch/x86/events/intel/uncore_snb.c | 9 ++------- > > arch/x86/events/msr.c | 10 ++-------- > > 6 files changed, 12 insertions(+), 51 deletions(-) > > You (correctly) don't add CAP_NO_EXCLUDE to the main x86 pmu code, but > then you also don't check if it handles all the various exclude options > correctly/consistently. > > Now; I must admit that that is a bit of a maze, but I think we can at > least add exclude_idle and exclude_hv fails in there, nothing uses those > afaict. Yes it took me some time to make sense of it. As per my comments in the other patch, I think you're suggesting that I add additional checks to x86. I think they are needed but I'd prefer to make functional changes in a separate series, I'm happy to do this. > > On the various exclude options; they are as follows (IIUC): > > - exclude_guest: we're a HV/host-kernel and we don't want the counter > to run when we run a guest context. > > - exclude_host: we're a HV/host-kernel and we don't want the counter > to run when we run in host context. > > - exclude_hv: we're a guest and don't want the counter to run in HV > context. > > Now, KVM always implies exclude_hv afaict (for guests), It certaintly does for ARM. > I'm not sure > what, if anything Xen does on x86 (IIRC Brendan Gregg once said perf > works on Xen) -- nor quite sure who to ask, Boris, Jeurgen? Thanks, Andrew Murray >