Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754214AbcCUJxF (ORCPT ); Mon, 21 Mar 2016 05:53:05 -0400 Received: from [198.137.202.10] ([198.137.202.10]:45244 "EHLO terminus.zytor.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754073AbcCUJw6 (ORCPT ); Mon, 21 Mar 2016 05:52:58 -0400 Date: Mon, 21 Mar 2016 02:49:02 -0700 From: tip-bot for Peter Zijlstra Message-ID: Cc: acme@redhat.com, jolsa@redhat.com, peterz@infradead.org, namhyung@kernel.org, vince@deater.net, luto@amacapital.net, bp@alien8.de, hpa@zytor.com, mingo@kernel.org, dsahern@gmail.com, eranian@google.com, torvalds@linux-foundation.org, vincent.weaver@maine.edu, dvlasenk@redhat.com, brgerst@gmail.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org Reply-To: acme@redhat.com, vince@deater.net, jolsa@redhat.com, namhyung@kernel.org, peterz@infradead.org, bp@alien8.de, luto@amacapital.net, mingo@kernel.org, hpa@zytor.com, dsahern@gmail.com, eranian@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, brgerst@gmail.com, tglx@linutronix.de, dvlasenk@redhat.com, vincent.weaver@maine.edu In-Reply-To: <20160311142346.GE6344@twins.programming.kicks-ass.net> References: <20160311142346.GE6344@twins.programming.kicks-ass.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf/x86/ibs: Fix IBS throttle Git-Commit-ID: 0158b83f7508851cda9e62c4b14678c5bd492cb2 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 Content-Length: 2119 Lines: 56 Commit-ID: 0158b83f7508851cda9e62c4b14678c5bd492cb2 Gitweb: http://git.kernel.org/tip/0158b83f7508851cda9e62c4b14678c5bd492cb2 Author: Peter Zijlstra AuthorDate: Fri, 11 Mar 2016 15:23:46 +0100 Committer: Ingo Molnar CommitDate: Mon, 21 Mar 2016 09:08:15 +0100 perf/x86/ibs: Fix IBS throttle When the IBS IRQ handler get a !0 return from perf_event_overflow; meaning it should throttle the event, it only disables it, it doesn't call perf_ibs_stop(). This confuses the state machine, as we'll use pmu::start() -> perf_ibs_start() to unthrottle. Tested-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Brian Gerst Cc: David Ahern Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Linus Torvalds Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: Vince Weaver Cc: dvyukov@google.com Cc: oleg@redhat.com Cc: panand@redhat.com Cc: sasha.levin@oracle.com Link: http://lkml.kernel.org/r/20160311142346.GE6344@twins.programming.kicks-ass.net Signed-off-by: Ingo Molnar --- arch/x86/events/amd/ibs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c index 51087c2..7956d29 100644 --- a/arch/x86/events/amd/ibs.c +++ b/arch/x86/events/amd/ibs.c @@ -599,7 +599,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs) throttle = perf_event_overflow(event, &data, ®s); out: if (throttle) - perf_ibs_disable_event(perf_ibs, hwc, *config); + perf_ibs_stop(event, 0); else perf_ibs_enable_event(perf_ibs, hwc, period >> 4);