Messages in this thread | | | Subject | Re: CPU Hotplug rework | From | Steven Rostedt <> | Date | Tue, 10 Apr 2012 20:09:59 -0400 |
| |
On Sat, 2012-04-07 at 01:22 +0530, Srivatsa S. Bhat wrote:
> Wrapping only do_setup() within get/put_online_cpus() wouldn't serve our > purpose, since the race with CPU Hotplug would still exist, just like > before. So, let's consider what happens when we wrap both the functions > within get/put_online_cpus(): > > get_online_cpus(); > register_cpu_notifier(nb, mask); > do_setup(mask); > put_online_cpus(); > > Unfortunately this leads to an ABBA deadlock (see below). >
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).
and then in the above code do:
cpu_maps_update_begin(); __register_cpu_notifier(nb); do_setup(); cpu_maps_update_done();
Just saying,
-- Steve
| |