diff options
Diffstat (limited to 'kernel/rcupdate.c')
| -rw-r--r-- | kernel/rcupdate.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index 8cf15a569fcd..6df1559b1c02 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
| @@ -47,15 +47,16 @@ | |||
| 47 | #include <linux/notifier.h> | 47 | #include <linux/notifier.h> |
| 48 | #include <linux/rcupdate.h> | 48 | #include <linux/rcupdate.h> |
| 49 | #include <linux/cpu.h> | 49 | #include <linux/cpu.h> |
| 50 | #include <linux/mutex.h> | ||
| 50 | 51 | ||
| 51 | /* Definition for rcupdate control block. */ | 52 | /* Definition for rcupdate control block. */ |
| 52 | struct rcu_ctrlblk rcu_ctrlblk = { | 53 | static struct rcu_ctrlblk rcu_ctrlblk = { |
| 53 | .cur = -300, | 54 | .cur = -300, |
| 54 | .completed = -300, | 55 | .completed = -300, |
| 55 | .lock = SPIN_LOCK_UNLOCKED, | 56 | .lock = SPIN_LOCK_UNLOCKED, |
| 56 | .cpumask = CPU_MASK_NONE, | 57 | .cpumask = CPU_MASK_NONE, |
| 57 | }; | 58 | }; |
| 58 | struct rcu_ctrlblk rcu_bh_ctrlblk = { | 59 | static struct rcu_ctrlblk rcu_bh_ctrlblk = { |
| 59 | .cur = -300, | 60 | .cur = -300, |
| 60 | .completed = -300, | 61 | .completed = -300, |
| 61 | .lock = SPIN_LOCK_UNLOCKED, | 62 | .lock = SPIN_LOCK_UNLOCKED, |
| @@ -75,7 +76,7 @@ static int rsinterval = 1000; | |||
| 75 | #endif | 76 | #endif |
| 76 | 77 | ||
| 77 | static atomic_t rcu_barrier_cpu_count; | 78 | static atomic_t rcu_barrier_cpu_count; |
| 78 | static struct semaphore rcu_barrier_sema; | 79 | static DEFINE_MUTEX(rcu_barrier_mutex); |
| 79 | static struct completion rcu_barrier_completion; | 80 | static struct completion rcu_barrier_completion; |
| 80 | 81 | ||
| 81 | #ifdef CONFIG_SMP | 82 | #ifdef CONFIG_SMP |
| @@ -207,13 +208,13 @@ static void rcu_barrier_func(void *notused) | |||
| 207 | void rcu_barrier(void) | 208 | void rcu_barrier(void) |
| 208 | { | 209 | { |
| 209 | BUG_ON(in_interrupt()); | 210 | BUG_ON(in_interrupt()); |
| 210 | /* Take cpucontrol semaphore to protect against CPU hotplug */ | 211 | /* Take cpucontrol mutex to protect against CPU hotplug */ |
| 211 | down(&rcu_barrier_sema); | 212 | mutex_lock(&rcu_barrier_mutex); |
| 212 | init_completion(&rcu_barrier_completion); | 213 | init_completion(&rcu_barrier_completion); |
| 213 | atomic_set(&rcu_barrier_cpu_count, 0); | 214 | atomic_set(&rcu_barrier_cpu_count, 0); |
| 214 | on_each_cpu(rcu_barrier_func, NULL, 0, 1); | 215 | on_each_cpu(rcu_barrier_func, NULL, 0, 1); |
| 215 | wait_for_completion(&rcu_barrier_completion); | 216 | wait_for_completion(&rcu_barrier_completion); |
| 216 | up(&rcu_barrier_sema); | 217 | mutex_unlock(&rcu_barrier_mutex); |
| 217 | } | 218 | } |
| 218 | EXPORT_SYMBOL_GPL(rcu_barrier); | 219 | EXPORT_SYMBOL_GPL(rcu_barrier); |
| 219 | 220 | ||
| @@ -549,7 +550,6 @@ static struct notifier_block __devinitdata rcu_nb = { | |||
| 549 | */ | 550 | */ |
| 550 | void __init rcu_init(void) | 551 | void __init rcu_init(void) |
| 551 | { | 552 | { |
| 552 | sema_init(&rcu_barrier_sema, 1); | ||
| 553 | rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, | 553 | rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, |
| 554 | (void *)(long)smp_processor_id()); | 554 | (void *)(long)smp_processor_id()); |
| 555 | /* Register notifier for non-boot CPUs */ | 555 | /* Register notifier for non-boot CPUs */ |
| @@ -609,7 +609,7 @@ module_param(qlowmark, int, 0); | |||
| 609 | module_param(rsinterval, int, 0); | 609 | module_param(rsinterval, int, 0); |
| 610 | #endif | 610 | #endif |
| 611 | EXPORT_SYMBOL_GPL(rcu_batches_completed); | 611 | EXPORT_SYMBOL_GPL(rcu_batches_completed); |
| 612 | EXPORT_SYMBOL(call_rcu); /* WARNING: GPL-only in April 2006. */ | 612 | EXPORT_SYMBOL_GPL_FUTURE(call_rcu); /* WARNING: GPL-only in April 2006. */ |
| 613 | EXPORT_SYMBOL(call_rcu_bh); /* WARNING: GPL-only in April 2006. */ | 613 | EXPORT_SYMBOL_GPL_FUTURE(call_rcu_bh); /* WARNING: GPL-only in April 2006. */ |
| 614 | EXPORT_SYMBOL_GPL(synchronize_rcu); | 614 | EXPORT_SYMBOL_GPL(synchronize_rcu); |
| 615 | EXPORT_SYMBOL(synchronize_kernel); /* WARNING: GPL-only in April 2006. */ | 615 | EXPORT_SYMBOL_GPL_FUTURE(synchronize_kernel); /* WARNING: GPL-only in April 2006. */ |
