Skip to contentSkip to conversation

rcu: Fix RCU & CPU hotplug hang

tip:core/rcu tip-bot for Paul E. McKenney 1 participant 1 message Aug 2, 2009

lore
Share & tools
lore
#0 lore raw
Commit-ID:  04b06256ccdd0af50ece04530f7dde0f81aa8f46
Gitweb:     http://git.kernel.org/tip/04b06256ccdd0af50ece04530f7dde0f81aa8f46
Author:     Paul E. McKenney <[email protected]>
AuthorDate: Fri, 31 Jul 2009 23:25:50 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sun, 2 Aug 2009 16:08:47 +0200

rcu: Fix RCU & CPU hotplug hang

This patch divides the rcutree initialization into boot-time and hotplug-time components, so that the tree data structures are guaranteed to be fully linked at boot time regardless of what might happen in CPU hotplug operations.

This should prevent the noted panic, but then again so should the pre-patch setup...

LKML-Reference: <new-submission>

---
 kernel/rcupdate.c   |   12 +++++++++-
 kernel/rcupreempt.c |    9 -------
 kernel/rcutree.c    |   62 +++++++++++++++++++++++++++-----------------------
 3 files changed, 44 insertions(+), 39 deletions(-)
kernel/rcupdate.c +11 -1
index 3fea910..9f0584e 100644
@@ -248,8 +248,18 @@ static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self,
 
 void __init rcu_init(void)
 {
-	hotcpu_notifier(rcu_barrier_cpu_hotplug, 0);
+	int i;
+
 	__rcu_init();
+	hotcpu_notifier(rcu_barrier_cpu_hotplug, 0);
+
+	/*
+	 * We don't need protection against CPU-hotplug here because
+	 * this is called early in boot, before either interrupts
+	 * or the scheduler are operational.
+	 */
+	for_each_online_cpu(i)
+		rcu_barrier_cpu_hotplug(NULL, CPU_UP_PREPARE, (void *)(long)i);
 }
 
 void rcu_scheduler_starting(void)
kernel/rcupreempt.c +0 -9
index 4300212..5948353 100644
@@ -1467,15 +1467,6 @@ void __init __rcu_init(void)
 		rdp->waitschedtail = &rdp->waitschedlist;
 		rdp->rcu_sched_sleeping = 0;
 	}
-
-	/*
-	 * We don't need protection against CPU-hotplug here because
-	 * this is called early in boot, before either interrupts
-	 * or the scheduler are operational.
-	 */
-	for_each_online_cpu(cpu)
-		rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long) cpu);
-
 	open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
 }
 
kernel/rcutree.c +33 -29

88 lines not on this page · raw message