- spin_lock_irq(&rcu_ctrlblk.mutex);
- if (cpus_empty(rcu_ctrlblk.rcu_cpu_mask))
- goto unlock;
-
- cpu_clear(cpu, rcu_ctrlblk.rcu_cpu_mask);
- if (cpus_empty(rcu_ctrlblk.rcu_cpu_mask)) {
- rcu_ctrlblk.curbatch++;
- /* We may avoid calling start batch if
- * we are starting the batch only
- * because of the DEAD CPU (the current
- * CPU will start a new batch anyway for
- * the callbacks we will move to current CPU).
- * However, we will avoid this optimisation
- * for now.
- */
- rcu_start_batch(rcu_ctrlblk.maxbatch);
- }
-unlock:
- spin_unlock_irq(&rcu_ctrlblk.mutex);
+ spin_lock_bh(&rsp->lock);
+ if (rcp->cur != rcp->completed)
+ cpu_quiet(rdp->cpu, rcp, rsp);
+ spin_unlock_bh(&rsp->lock);
+ rcu_move_batch(this_rdp, rdp->curlist, rdp->curtail);
+ rcu_move_batch(this_rdp, rdp->nxtlist, rdp->nxttail);
+
+}
+static void rcu_offline_cpu(int cpu)
+{
+ struct rcu_data *this_rdp = &get_cpu_var(rcu_data);
+ struct rcu_data *this_bh_rdp = &get_cpu_var(rcu_bh_data);
+
+ __rcu_offline_cpu(this_rdp, &rcu_ctrlblk, &rcu_state,
+ &per_cpu(rcu_data, cpu));
+ __rcu_offline_cpu(this_bh_rdp, &rcu_bh_ctrlblk, &rcu_bh_state,
+ &per_cpu(rcu_bh_data, cpu));
+ put_cpu_var(rcu_data);
+ put_cpu_var(rcu_bh_data);
+ tasklet_kill_immediate(&per_cpu(rcu_tasklet, cpu), cpu);
+}