Re: CPU Hotplug rework

From: Paul E. McKenney
Date: Tue Apr 10 2012 - 21:00:35 EST


On Tue, Apr 10, 2012 at 08:37:18PM -0400, Steven Rostedt wrote:
> On Tue, 2012-04-10 at 17:28 -0700, Paul E. McKenney wrote:
>
> > > Just to throw out the stupid silly approach.
> > >
> > > What about creating a "__register_cpu_notifier()" that just does:
> > >
> > > int __ref __register_cpu_notifier(struct notifier_block *nb)
> > > {
> > > return raw_notifier_chain_register(&cpu_chain, nb);
> > > }
> > >
> > > Also making cpu_maps_update_begin/done() global (and probably rename
> > > them).
>
> I just noticed that the cpu_maps_update_begin/done() are already global.
>
> > >
> > > and then in the above code do:
> > >
> > > cpu_maps_update_begin();
> > > __register_cpu_notifier(nb);
> > > do_setup();
> > > cpu_maps_update_done();
> > >
> > >
> > > Just saying,
> >
> > That does have some attractive properties, now that you mention it. ;-)
>
> Which property? Stupid or Silly ;-)

As with any piece of software, no matter how small, both. ;-)

Of course, __register_cpu_notifier() would need lockdep checking to make
sure that it wasn't called without the benefit of cpu_maps_update_begin().
I might be missing something, but as long as that was in place, seems
like it is a lot simpler and easier to use than the alternatives that
Srivatsa and I were kicking around.

Thanx, Paul

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