From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933849AbcIVOCn (ORCPT ); Thu, 22 Sep 2016 10:02:43 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56844 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756967AbcIVOCk (ORCPT ); Thu, 22 Sep 2016 10:02:40 -0400 Date: Thu, 22 Sep 2016 07:01:27 -0700 From: tip-bot for Alexander Shishkin Message-ID: Cc: vincent.weaver@maine.edu, hpa@zytor.com, peterz@infradead.org, torvalds@linux-foundation.org, acme@infradead.org, jolsa@redhat.com, linux-kernel@vger.kernel.org, acme@redhat.com, mingo@kernel.org, alexander.shishkin@linux.intel.com, a.p.zijlstra@chello.nl, eranian@google.com, tglx@linutronix.de Reply-To: vincent.weaver@maine.edu, peterz@infradead.org, hpa@zytor.com, torvalds@linux-foundation.org, acme@infradead.org, jolsa@redhat.com, acme@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, alexander.shishkin@linux.intel.com, a.p.zijlstra@chello.nl, eranian@google.com, tglx@linutronix.de In-Reply-To: <20160920154811.3255-3-alexander.shishkin@linux.intel.com> References: <20160920154811.3255-3-alexander.shishkin@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf/core: Limit matching exclusive events to one PMU Git-Commit-ID: 3bf6215a1b30db7df6083c708caab3fe1a8e8abe X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 3bf6215a1b30db7df6083c708caab3fe1a8e8abe Gitweb: http://git.kernel.org/tip/3bf6215a1b30db7df6083c708caab3fe1a8e8abe Author: Alexander Shishkin AuthorDate: Tue, 20 Sep 2016 18:48:11 +0300 Committer: Ingo Molnar CommitDate: Thu, 22 Sep 2016 14:56:09 +0200 perf/core: Limit matching exclusive events to one PMU An "exclusive" PMU is the one that can only have one event scheduled in at any given time. There may be more than one of such PMUs in a system, though, like Intel PT and BTS. It should be allowed to have one event for either of those inside the same context (there may be other constraints that may prevent this, but those would be hardware-specific). However, the exclusivity code is written so that only one event from any of the "exclusive" PMUs is allowed in a context. Fix this by making the exclusive event filter explicitly match two events' PMUs. Signed-off-by: Alexander Shishkin Acked-by: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: vince@deater.net Link: http://lkml.kernel.org/r/20160920154811.3255-3-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar --- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index a54f2c2..fc9bb22 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -3929,7 +3929,7 @@ static void exclusive_event_destroy(struct perf_event *event) static bool exclusive_event_match(struct perf_event *e1, struct perf_event *e2) { - if ((e1->pmu->capabilities & PERF_PMU_CAP_EXCLUSIVE) && + if ((e1->pmu == e2->pmu) && (e1->cpu == e2->cpu || e1->cpu == -1 || e2->cpu == -1))