aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-01-16 17:01:21 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-03-11 16:22:36 -0400
commitb33078b6098148c3efdacc907249a247c9d5491e (patch)
tree8a9128a42b47bac12419fe875eaef1ba9534932d /kernel/rcu/tree.c
parent490ab882e2719f5e809a0cb5af7fda4620b66dca (diff)
rcu: Consolidate offline-CPU callback initialization
Currently, both rcu_cleanup_dead_cpu() and rcu_send_cbs_to_orphanage() initialize the outgoing CPU's callback list. However, only rcu_cleanup_dead_cpu() invokes rcu_send_cbs_to_orphanage(), and it does so unconditionally, which means that only one of these initializations is required. This commit therefore consolidates the callback-list initialization with the rest of the callback handling in rcu_send_cbs_to_orphanage(). Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 48d640ca1a05..8e020c59ecfd 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2256,8 +2256,12 @@ rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp,
2256 rsp->orphan_donetail = rdp->nxttail[RCU_DONE_TAIL]; 2256 rsp->orphan_donetail = rdp->nxttail[RCU_DONE_TAIL];
2257 } 2257 }
2258 2258
2259 /* Finally, initialize the rcu_data structure's list to empty. */ 2259 /*
2260 * Finally, initialize the rcu_data structure's list to empty and
2261 * disallow further callbacks on this CPU.
2262 */
2260 init_callback_list(rdp); 2263 init_callback_list(rdp);
2264 rdp->nxttail[RCU_NEXT_TAIL] = NULL;
2261} 2265}
2262 2266
2263/* 2267/*
@@ -2398,9 +2402,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
2398 WARN_ONCE(rdp->qlen != 0 || rdp->nxtlist != NULL, 2402 WARN_ONCE(rdp->qlen != 0 || rdp->nxtlist != NULL,
2399 "rcu_cleanup_dead_cpu: Callbacks on offline CPU %d: qlen=%lu, nxtlist=%p\n", 2403 "rcu_cleanup_dead_cpu: Callbacks on offline CPU %d: qlen=%lu, nxtlist=%p\n",
2400 cpu, rdp->qlen, rdp->nxtlist); 2404 cpu, rdp->qlen, rdp->nxtlist);
2401 init_callback_list(rdp);
2402 /* Disallow further callbacks on this CPU. */
2403 rdp->nxttail[RCU_NEXT_TAIL] = NULL;
2404 mutex_unlock(&rsp->onoff_mutex); 2405 mutex_unlock(&rsp->onoff_mutex);
2405} 2406}
2406 2407