* [PATCH] perf_events: fix BTS interrupt handling to avoid being dazed by NMI
@ 2010-09-10 11:09 Stephane Eranian
2010-09-10 11:16 ` Stephane Eranian
0 siblings, 1 reply; 2+ messages in thread
From: Stephane Eranian @ 2010-09-10 11:09 UTC (permalink / raw)
To: linux-kernel
Cc: peterz, mingo, paulus, davem, fweisbec, perfmon2-devel, eranian,
eranian, robert.richter, dzickus
Fix a bug introduced with commit de725de and the change in the meaning of the
return value of intel_pmu_handle_irq(). With the current code, when you are
using the BTS, you get 'dazed by NMI' each time the BTS buffer fills up.
BTS does interrupt on the PMU vector, thus NMI. You need to take this
into account in the return value of the function.
Signed-off-by: Stephane Eranian <eranian@google.com>
--
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index ee05c90..b4d2e1c 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -713,18 +713,18 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
struct cpu_hw_events *cpuc;
int bit, loops;
u64 status;
- int handled = 0;
+ int handled;
perf_sample_data_init(&data, 0);
cpuc = &__get_cpu_var(cpu_hw_events);
intel_pmu_disable_all();
- intel_pmu_drain_bts_buffer();
+ handled = intel_pmu_drain_bts_buffer();
status = intel_pmu_get_status();
if (!status) {
intel_pmu_enable_all(0);
- return 0;
+ return handled;
}
loops = 0;
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] perf_events: fix BTS interrupt handling to avoid being dazed by NMI
2010-09-10 11:09 [PATCH] perf_events: fix BTS interrupt handling to avoid being dazed by NMI Stephane Eranian
@ 2010-09-10 11:16 ` Stephane Eranian
0 siblings, 0 replies; 2+ messages in thread
From: Stephane Eranian @ 2010-09-10 11:16 UTC (permalink / raw)
To: linux-kernel
Cc: peterz, mingo, paulus, davem, fweisbec, perfmon2-devel, eranian,
eranian, robert.richter, dzickus
Sorry, my patch is missing one piece. I will repost.
On Fri, Sep 10, 2010 at 1:09 PM, Stephane Eranian <eranian@google.com> wrote:
> Fix a bug introduced with commit de725de and the change in the meaning of the
> return value of intel_pmu_handle_irq(). With the current code, when you are
> using the BTS, you get 'dazed by NMI' each time the BTS buffer fills up.
>
> BTS does interrupt on the PMU vector, thus NMI. You need to take this
> into account in the return value of the function.
>
> Signed-off-by: Stephane Eranian <eranian@google.com>
> --
>
> diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
> index ee05c90..b4d2e1c 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel.c
> @@ -713,18 +713,18 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
> struct cpu_hw_events *cpuc;
> int bit, loops;
> u64 status;
> - int handled = 0;
> + int handled;
>
> perf_sample_data_init(&data, 0);
>
> cpuc = &__get_cpu_var(cpu_hw_events);
>
> intel_pmu_disable_all();
> - intel_pmu_drain_bts_buffer();
> + handled = intel_pmu_drain_bts_buffer();
> status = intel_pmu_get_status();
> if (!status) {
> intel_pmu_enable_all(0);
> - return 0;
> + return handled;
> }
>
> loops = 0;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-10 11:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10 11:09 [PATCH] perf_events: fix BTS interrupt handling to avoid being dazed by NMI Stephane Eranian
2010-09-10 11:16 ` Stephane Eranian
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.