lkml.org 
[lkml]   [2011]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [V4][PATCH 4/6] x86, nmi: add in logic to handle multiple events and unknown NMIs
On 14.09.11 08:56:40, Don Zickus wrote:
> On Tue, Sep 13, 2011 at 04:58:27PM -0400, Don Zickus wrote:
> >
> > V3:
> > - redesigned the algorithm to utilize Avi's idea of detecting a back-to-back
> > NMI with %rip.
>
> Hi Robert,
>
> I realized I added an optimization for executing the nmi handlers to help
> minimize the impact on the virt folks and realize it might break your IBS
> stuff.
>
> > -static int notrace __kprobes nmi_handle(unsigned int type, struct pt_regs *regs)
> > +static int notrace __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2b)
> > {
> > struct nmi_desc *desc = nmi_to_desc(type);
> > struct nmiaction *next_a, *a, **ap = &desc->head;
> > @@ -87,6 +87,16 @@ static int notrace __kprobes nmi_handle(unsigned int type, struct pt_regs *regs)
> >
> > handled += a->handler(type, regs);
> >
> > + /*
> > + * Optimization: only loop once if this is not a
> > + * back-to-back NMI. The idea is nothing is dropped
> > + * on the first NMI, only on the second of a back-to-back
> > + * NMI. No need to waste cycles going through all the
> > + * handlers.
> > + */
> > + if (!b2b && handled)
> > + break;
> > +
> > a = next_a;
> > }
> > rcu_read_unlock();
>
> The optimization is to run through the handlers until one of them claims
> the NMI but only for the first NMI. Whereas on the second half of a
> back-to-back NMI, run through all the handlers regardless of how many
> claim they handled it.
>
> Does your IBS stuff need to always run through two handlers?

As said in my previous answer, it might probably work, but I will test
it.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center



\
 
 \ /
  Last update: 2011-09-14 22:25    [W:0.334 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site