Messages in this thread | | | Date | Wed, 14 Sep 2011 22:20:15 +0200 | From | Robert Richter <> | Subject | Re: [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
| |