aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 4fccdfa25716..aa7cade1b9f3 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3665,6 +3665,8 @@ int rcutree_dead_cpu(unsigned int cpu)
3665 return 0; 3665 return 0;
3666} 3666}
3667 3667
3668static DEFINE_PER_CPU(int, rcu_cpu_started);
3669
3668/* 3670/*
3669 * Mark the specified CPU as being online so that subsequent grace periods 3671 * Mark the specified CPU as being online so that subsequent grace periods
3670 * (both expedited and normal) will wait on it. Note that this means that 3672 * (both expedited and normal) will wait on it. Note that this means that
@@ -3686,6 +3688,11 @@ void rcu_cpu_starting(unsigned int cpu)
3686 struct rcu_node *rnp; 3688 struct rcu_node *rnp;
3687 struct rcu_state *rsp; 3689 struct rcu_state *rsp;
3688 3690
3691 if (per_cpu(rcu_cpu_started, cpu))
3692 return;
3693
3694 per_cpu(rcu_cpu_started, cpu) = 1;
3695
3689 for_each_rcu_flavor(rsp) { 3696 for_each_rcu_flavor(rsp) {
3690 rdp = per_cpu_ptr(rsp->rda, cpu); 3697 rdp = per_cpu_ptr(rsp->rda, cpu);
3691 rnp = rdp->mynode; 3698 rnp = rdp->mynode;
@@ -3742,6 +3749,8 @@ void rcu_report_dead(unsigned int cpu)
3742 preempt_enable(); 3749 preempt_enable();
3743 for_each_rcu_flavor(rsp) 3750 for_each_rcu_flavor(rsp)
3744 rcu_cleanup_dying_idle_cpu(cpu, rsp); 3751 rcu_cleanup_dying_idle_cpu(cpu, rsp);
3752
3753 per_cpu(rcu_cpu_started, cpu) = 0;
3745} 3754}
3746 3755
3747/* Migrate the dead CPU's callbacks to the current CPU. */ 3756/* Migrate the dead CPU's callbacks to the current CPU. */