Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932873AbbHDI7V (ORCPT ); Tue, 4 Aug 2015 04:59:21 -0400 Received: from terminus.zytor.com ([198.137.202.10]:50213 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932331AbbHDI7R (ORCPT ); Tue, 4 Aug 2015 04:59:17 -0400 Date: Tue, 4 Aug 2015 01:58:44 -0700 From: tip-bot for Andi Kleen Message-ID: Cc: mingo@kernel.org, tglx@linutronix.de, ak@linux.intel.com, linux-kernel@vger.kernel.org, peterz@infradead.org, hpa@zytor.com, torvalds@linux-foundation.org Reply-To: mingo@kernel.org, tglx@linutronix.de, peterz@infradead.org, ak@linux.intel.com, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org In-Reply-To: <1431285767-27027-9-git-send-email-andi@firstfloor.org> References: <1431285767-27027-9-git-send-email-andi@firstfloor.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf/x86/intel/lbr: Optimize v4 LBR unfreezing Git-Commit-ID: 425507fa5f321bb5ce1b5eb57a9586e0cf0b9802 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: 1857 Lines: 49 Commit-ID: 425507fa5f321bb5ce1b5eb57a9586e0cf0b9802 Gitweb: http://git.kernel.org/tip/425507fa5f321bb5ce1b5eb57a9586e0cf0b9802 Author: Andi Kleen AuthorDate: Sun, 10 May 2015 12:22:46 -0700 Committer: Ingo Molnar CommitDate: Tue, 4 Aug 2015 10:16:58 +0200 perf/x86/intel/lbr: Optimize v4 LBR unfreezing In Arch perfmon v4 the GLOBAL_STATUS reset automatically unfreezes LBRs. So no need to do it manually in the LBR code. Add a check to skip it. v2: Move test up to beginning of function. Signed-off-by: Andi Kleen Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: eranian@google.com Link: http://lkml.kernel.org/r/1431285767-27027-9-git-send-email-andi@firstfloor.org Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/perf_event_intel_lbr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c index 2fb5737..769a42f 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c +++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c @@ -141,6 +141,13 @@ static void __intel_pmu_lbr_enable(bool pmi) u64 debugctl, lbr_select = 0, orig_debugctl; /* + * No need to unfreeze manually, as v4 can do that as part + * of the GLOBAL_STATUS ack. + */ + if (pmi && x86_pmu.version >= 4) + return; + + /* * No need to reprogram LBR_SELECT in a PMI, as it * did not change. */ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/