Re: [patch]x86: spread tlb flush vector between nodes

From: Ingo Molnar
Date: Wed Oct 13 2010 - 07:19:30 EST



* Shaohua Li <shaohua.li@xxxxxxxxx> wrote:

> On Wed, 2010-10-13 at 16:16 +0800, Andi Kleen wrote:
> > On Wed, Oct 13, 2010 at 03:41:38PM +0800, Shaohua Li wrote:
> > > +
> > > +static int tlb_cpuhp_notify(struct notifier_block *n,
> > > + unsigned long action, void *hcpu)
> > > +{
> > > + switch (action & 0xf) {
> > > + case CPU_ONLINE:
> > > + case CPU_DEAD:
> > > + calculate_tlb_offset();
> > > + }
> > > + return NOTIFY_OK;
> >
> > I don't think we really need the complexity of a notifier here.
> > In most x86 setups possible is very similar to online.
> >
> > So I would suggest simply to compute a static mapping at boot
> > and simplify the code.
> >
> > In theory there is a slight danger of node<->CPU numbers
> > changing with consecutive hot plug actions, but right now
> > this should not happen anyways and it would be unlikely
> > later.
>
> yes, it's unlikely. could we get the node info for a CPU before it's
> hotplugged? Anyway, this doesn't take overhead.

It would be rather stupid to throw away the fairly simple hotplug-aware
code you wrote and replace it with some lame boot-time calculated
mapping just because currently it's considered rare.

Thanks,

Ingo
--
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/