spin_unlock_irqrestore(&rdp->lock, flags);
}
- void __devinit rcu_online_cpu(int cpu)
+ #else /* #ifdef CONFIG_HOTPLUG_CPU */
+
+ void rcu_offline_cpu(int cpu)
+ {
+ }
+
+ #endif /* #else #ifdef CONFIG_HOTPLUG_CPU */
+
+ void __cpuinit rcu_online_cpu(int cpu)
{
unsigned long flags;
+ struct rcu_data *rdp;
spin_lock_irqsave(&rcu_ctrlblk.fliplock, flags);
cpu_set(cpu, rcu_cpu_online_map);
spin_unlock_irqrestore(&rcu_ctrlblk.fliplock, flags);
+
+ /*
+ * The rcu_sched grace-period processing might have bypassed
+ * this CPU, given that it was not in the rcu_cpu_online_map
+ * when the grace-period scan started. This means that the
+ * grace-period task might sleep. So make sure that if this
+ * should happen, the first callback posted to this CPU will
+ * wake up the grace-period task if need be.
+ */
+
+ rdp = RCU_DATA_CPU(cpu);
+ spin_lock_irqsave(&rdp->lock, flags);
+ rdp->rcu_sched_sleeping = 1;
+ spin_unlock_irqrestore(&rdp->lock, flags);
}
- #else /* #ifdef CONFIG_HOTPLUG_CPU */
-
- void rcu_offline_cpu(int cpu)
- {
- }
-
- void __devinit rcu_online_cpu(int cpu)
- {
- }
-
- #endif /* #else #ifdef CONFIG_HOTPLUG_CPU */
-
static void rcu_process_callbacks(struct softirq_action *unused)
{
unsigned long flags;