Re: [PATCH] x86, UV: Fix NMI handler for UV platforms

From: Don Zickus
Date: Wed Mar 23 2011 - 17:22:35 EST


On Wed, Mar 23, 2011 at 11:45:20PM +0300, Cyrill Gorcunov wrote:
> On 03/23/2011 11:00 PM, Don Zickus wrote:
> > On Wed, Mar 23, 2011 at 01:53:20PM -0400, Don Zickus wrote:
> >> Let me know if the patch fixes that problem. Then it will be one less
> >> thing to worry about. :-)
> >
> > Ok, I was an idiot and made the patch against RHEL-6. Here is the one
> > against 2.6.38. Sorry about that.
> >
> > Cheers,
> > Don
> >
> >
> > diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
> > index 87eab4a..62ec8e9 100644
> > --- a/arch/x86/kernel/cpu/perf_event.c
> > +++ b/arch/x86/kernel/cpu/perf_event.c
> > @@ -1375,7 +1375,7 @@ perf_event_nmi_handler(struct notifier_block *self,
> > if ((handled > 1) ||
> > /* the next nmi could be a back-to-back nmi */
> > ((__this_cpu_read(pmu_nmi.marked) == this_nmi) &&
> > - (__this_cpu_read(pmu_nmi.handled) > 1))) {
> > + (__this_cpu_read(pmu_nmi.handled) > 0) && handled && this_nmi)) {
>
> Don, why do you need to check for this_nmi here? it's zero for first nmi in a
> system (right?), so I fail to get the reason for such check. What I miss?

It was a stupid optimization, otherwise it _always_ traverses on the
first nmi. I wasn't sure that is what I wanted. Mainly I was trying to
wrap my head around the problem. You can remove it to see if the problem
is still fixed.

I'm not a fan of this fix as it is getting a little ugly, but for now...

Cheers,
Don
--
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/