Re: [PATCH] perf_events: fix BTS interrupt handling to avoid beingdazed by NMI

From: Stephane Eranian
Date: Fri Sep 10 2010 - 07:16:46 EST


Sorry, my patch is missing one piece. I will repost.


On Fri, Sep 10, 2010 at 1:09 PM, Stephane Eranian <eranian@xxxxxxxxxx> 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@xxxxxxxxxx>
> --
>
> 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;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/