[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110914125640.GT5795@redhat.com>
Date: Wed, 14 Sep 2011 08:56:40 -0400
From: Don Zickus <dzickus@...hat.com>
To: x86@...nel.org, Andi Kleen <andi@...stfloor.org>,
Robert Richter <robert.richter@....com>,
Peter Zijlstra <peterz@...radead.org>, ying.huang@...el.com
Cc: LKML <linux-kernel@...r.kernel.org>, paulmck@...ux.vnet.ibm.com,
avi@...hat.com, jeremy@...p.org
Subject: Re: [V4][PATCH 4/6] x86, nmi: add in logic to handle multiple
events and unknown NMIs
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?
Cheers,
Don
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists