Well, afaik, the patch series is fairly clean, and I'm obviously perfectly
happy with the approach, so I have no objections.
But it looks buggy. This:
+static void cpu_hotplug_begin(void)
+{
+ mutex_lock(&cpu_hotplug.lock);
+ cpu_hotplug.active_writer = current;
+ while (cpu_hotplug.refcount) {
+ mutex_unlock(&cpu_hotplug.lock);
+ wait_for_completion(&cpu_hotplug.readers_done);
+ mutex_lock(&cpu_hotplug.lock);
+ }
+
+}
drops the cpu_hotplug.lock, which - as far as I can see - means that
another process can come in and do the same, and mess up the
"active_writer" thing. The oerson that actually *gets* the lock may not be
the same one that has "active_writer" set to itself. No? Am I missing
something.
So I think this needs (a) more people looking at it (I think I found a
bug, who knows if there are more subtle ones lurking) and (b) lots of
testing.
Linus
-