From: Ingo Molnar Convert kernel/rcupdate's rcu_barrier_sema to mutex. Signed-off-by: Ingo Molnar Cc: "Paul E. McKenney" Signed-off-by: Andrew Morton --- kernel/rcupdate.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff -puN kernel/rcupdate.c~convert-kernel-rcupdatecrcu_barrier_sema-to-mutex kernel/rcupdate.c --- 25/kernel/rcupdate.c~convert-kernel-rcupdatecrcu_barrier_sema-to-mutex Thu Jan 12 16:34:47 2006 +++ 25-akpm/kernel/rcupdate.c Thu Jan 12 16:34:47 2006 @@ -47,6 +47,7 @@ #include #include #include +#include /* Definition for rcupdate control block. */ struct rcu_ctrlblk rcu_ctrlblk = { @@ -100,7 +101,7 @@ void fastcall call_rcu(struct rcu_head * } static atomic_t rcu_barrier_cpu_count; -static struct semaphore rcu_barrier_sema; +static DEFINE_MUTEX(rcu_barrier_mutex); static struct completion rcu_barrier_completion; /** @@ -175,13 +176,13 @@ static void rcu_barrier_func(void *notus void rcu_barrier(void) { BUG_ON(in_interrupt()); - /* Take cpucontrol semaphore to protect against CPU hotplug */ - down(&rcu_barrier_sema); + /* Take cpucontrol mutex to protect against CPU hotplug */ + mutex_lock(&rcu_barrier_mutex); init_completion(&rcu_barrier_completion); atomic_set(&rcu_barrier_cpu_count, 0); on_each_cpu(rcu_barrier_func, NULL, 0, 1); wait_for_completion(&rcu_barrier_completion); - up(&rcu_barrier_sema); + mutex_unlock(&rcu_barrier_mutex); } EXPORT_SYMBOL_GPL(rcu_barrier); @@ -514,7 +515,6 @@ static struct notifier_block __devinitda */ void __init rcu_init(void) { - sema_init(&rcu_barrier_sema, 1); rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, (void *)(long)smp_processor_id()); /* Register notifier for non-boot CPUs */ _