aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcupdate.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2009-08-15 12:53:48 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-15 13:02:08 -0400
commit2e597558086dec36d5c33521a36e0f6b1bc3f3a7 (patch)
treece8c6ced1c8a3b6bf6170a5894e1d7102e6ee9d4 /kernel/rcupdate.c
parent799e64f05f4bfaad2bb3165cab95c8c992a1c296 (diff)
rcu: Simplify RCU CPU-hotplug notification
Use the new cpu_notifier() API to simplify RCU's CPU-hotplug notifiers, collapsing down to a single such notifier. This makes it trivial to provide the notifier-ordering guarantee that rcu_barrier() depends on. Also remove redundant open_softirq() calls from Hierarchical RCU notifier. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: laijs@cn.fujitsu.com Cc: dipankar@in.ibm.com Cc: josht@linux.vnet.ibm.com Cc: akpm@linux-foundation.org Cc: mathieu.desnoyers@polymtl.ca Cc: dvhltc@us.ibm.com Cc: niv@us.ibm.com Cc: peterz@infradead.org Cc: rostedt@goodmis.org Cc: hugh.dickins@tiscali.co.uk Cc: benh@kernel.crashing.org LKML-Reference: <12503552312510-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r--kernel/rcupdate.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index eae29c25fb14..8df115600c2d 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -217,9 +217,13 @@ static void rcu_migrate_callback(struct rcu_head *notused)
217 wake_up(&rcu_migrate_wq); 217 wake_up(&rcu_migrate_wq);
218} 218}
219 219
220extern int rcu_cpu_notify(struct notifier_block *self,
221 unsigned long action, void *hcpu);
222
220static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self, 223static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self,
221 unsigned long action, void *hcpu) 224 unsigned long action, void *hcpu)
222{ 225{
226 rcu_cpu_notify(self, action, hcpu);
223 if (action == CPU_DYING) { 227 if (action == CPU_DYING) {
224 /* 228 /*
225 * preempt_disable() in on_each_cpu() prevents stop_machine(), 229 * preempt_disable() in on_each_cpu() prevents stop_machine(),
@@ -244,8 +248,18 @@ static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self,
244 248
245void __init rcu_init(void) 249void __init rcu_init(void)
246{ 250{
251 int i;
252
247 __rcu_init(); 253 __rcu_init();
248 hotcpu_notifier(rcu_barrier_cpu_hotplug, 0); 254 cpu_notifier(rcu_barrier_cpu_hotplug, 0);
255
256 /*
257 * We don't need protection against CPU-hotplug here because
258 * this is called early in boot, before either interrupts
259 * or the scheduler are operational.
260 */
261 for_each_online_cpu(i)
262 rcu_barrier_cpu_hotplug(NULL, CPU_UP_PREPARE, (void *)(long)i);
249} 263}
250 264
251void rcu_scheduler_starting(void) 265void rcu_scheduler_starting(void)