The code directly accessed the "cpucontrol" semaphore used
for CPU hotplug. That doesn't work all that well, since the
semaphore doesn't even exist on UP.
extern void unregister_cpu_notifier(struct notifier_block *nb);
int cpu_up(unsigned int cpu);
+
+#define lock_cpu_hotplug() down(&cpucontrol)
+#define unlock_cpu_hotplug() up(&cpucontrol)
+
#else
+
static inline int register_cpu_notifier(struct notifier_block *nb)
{
return 0;
static inline void unregister_cpu_notifier(struct notifier_block *nb)
{
}
+
+#define lock_cpu_hotplug() do { } while (0)
+#define unlock_cpu_hotplug() do { } while (0)
+
#endif /* CONFIG_SMP */
extern struct sysdev_class cpu_sysdev_class;
/* Don't want cpus going down or up during this, also protects
* against multiple callers. */
- down(&cpucontrol);
+ lock_cpu_hotplug();
atomic_set(&info.cpuleft, num_online_cpus());
init_completion(&info.completion);
local_bh_enable();
wait_for_completion(&info.completion);
- up(&cpucontrol);
+ unlock_cpu_hotplug();
}
static void __devinit flow_cache_cpu_prepare(int cpu)