mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Vince Weaver <vincent.weaver@maine.edu>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com,
	mingo@kernel.org, lawrence.f.meadows@intel.com,
	a.p.zijlstra@chello.nl, acme@ghostprotocols.net,
	vincent.weaver@maine.edu, tglx@linutronix.de
Subject: [tip:perf/urgent] perf/x86: Remove cpuc-> enable check on Intl KNC event enable/disable
Date: Wed, 24 Oct 2012 03:35:23 -0700	[thread overview]
Message-ID: <tip-7d011962afbaa6e572cd8e0dbb7abf773e166e64@git.kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1210171303290.23243@vincent-weaver-1.um.maine.edu>

Commit-ID:  7d011962afbaa6e572cd8e0dbb7abf773e166e64
Gitweb:     http://git.kernel.org/tip/7d011962afbaa6e572cd8e0dbb7abf773e166e64
Author:     Vince Weaver <vincent.weaver@maine.edu>
AuthorDate: Wed, 17 Oct 2012 13:04:33 -0400
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 24 Oct 2012 12:00:49 +0200

perf/x86: Remove cpuc->enable check on Intl KNC event enable/disable

x86_pmu.enable() is called from x86_pmu_enable() with
cpuc->enabled set to 0.  This means we weren't re-enabling the
counters after a context switch.

This patch just removes the check, as it should't be necessary
(and the equivelent x86_ generic code does not have the checks).

The origin of this problem is the KNC driver being based on the
P6 one.   The P6 driver also has this issue, but works anyway
due to various lucky accidents.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: eranian@gmail.com
Cc: Meadows
Cc: Lawrence F <lawrence.f.meadows@intel.com>
Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1210171303290.23243@vincent-weaver-1.um.maine.edu
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/cpu/perf_event_knc.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_knc.c b/arch/x86/kernel/cpu/perf_event_knc.c
index 73bcfbd..f3a2af4 100644
--- a/arch/x86/kernel/cpu/perf_event_knc.c
+++ b/arch/x86/kernel/cpu/perf_event_knc.c
@@ -173,26 +173,22 @@ static void knc_pmu_enable_all(int added)
 static inline void
 knc_pmu_disable_event(struct perf_event *event)
 {
-	struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
 	struct hw_perf_event *hwc = &event->hw;
 	u64 val;
 
 	val = hwc->config;
-	if (cpuc->enabled)
-		val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
+	val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
 
 	(void)wrmsrl_safe(hwc->config_base + hwc->idx, val);
 }
 
 static void knc_pmu_enable_event(struct perf_event *event)
 {
-	struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
 	struct hw_perf_event *hwc = &event->hw;
 	u64 val;
 
 	val = hwc->config;
-	if (cpuc->enabled)
-		val |= ARCH_PERFMON_EVENTSEL_ENABLE;
+	val |= ARCH_PERFMON_EVENTSEL_ENABLE;
 
 	(void)wrmsrl_safe(hwc->config_base + hwc->idx, val);
 }

  reply	other threads:[~2012-10-24 10:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 17:02 [PATCH 0/3] perf_event: enable overflow interrupts on KNC Vince Weaver
2012-10-17 17:03 ` [PATCH 1/3] Make KNC use full 40-bit width of counters Vince Weaver
2012-10-24 10:34   ` [tip:perf/urgent] perf/x86: Make Intel " tip-bot for Vince Weaver
2012-10-17 17:04 ` [PATCH 2/3] perf_event: Remove cpuc->enable check on KNC event enable/disable Vince Weaver
2012-10-24 10:35   ` tip-bot for Vince Weaver [this message]
2012-10-17 17:05 ` [PATCH 3/3] perf_event: Enable overflow on KNC with a custom knc_pmu_handle_irq() Vince Weaver
2012-10-24 10:36   ` [tip:perf/urgent] perf/x86: Enable overflow on Intel " tip-bot for Vince Weaver
2012-10-17 18:07 ` [PATCH 0/3] perf_event: enable overflow interrupts on KNC Ingo Molnar
2012-10-17 20:24   ` Vince Weaver
2012-10-17 21:47     ` Ingo Molnar
2012-10-18 17:54       ` Vince Weaver
2012-10-18 18:54         ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-7d011962afbaa6e572cd8e0dbb7abf773e166e64@git.kernel.org \
    --to=vincent.weaver@maine.edu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=hpa@zytor.com \
    --cc=lawrence.f.meadows@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome