From: Ingo Molnar Convert kernel/cpu.c from semaphore to mutex. I've reviewed all lock_cpu_hotplug() critical sections, and they all seem to fit mutex semantics. Signed-off-by: Ingo Molnar Cc: Rusty Russell Cc: Ashok Raj Signed-off-by: Andrew Morton --- kernel/cpu.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff -puN kernel/cpu.c~kernel-kernel-cpuc-to-mutexes kernel/cpu.c --- devel/kernel/cpu.c~kernel-kernel-cpuc-to-mutexes 2006-01-18 18:46:06.000000000 -0800 +++ devel-akpm/kernel/cpu.c 2006-01-18 18:46:06.000000000 -0800 @@ -13,10 +13,10 @@ #include #include #include -#include +#include /* This protects CPUs going up and down... */ -static DECLARE_MUTEX(cpucontrol); +static DEFINE_MUTEX(cpucontrol); static struct notifier_block *cpu_chain; @@ -30,9 +30,9 @@ static int __lock_cpu_hotplug(int interr if (lock_cpu_hotplug_owner != current) { if (interruptible) - ret = down_interruptible(&cpucontrol); + ret = mutex_lock_interruptible(&cpucontrol); else - down(&cpucontrol); + mutex_lock(&cpucontrol); } /* @@ -56,7 +56,7 @@ void unlock_cpu_hotplug(void) { if (--lock_cpu_hotplug_depth == 0) { lock_cpu_hotplug_owner = NULL; - up(&cpucontrol); + mutex_unlock(&cpucontrol); } } EXPORT_SYMBOL_GPL(unlock_cpu_hotplug); _