aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-03-19 14:32:11 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-06-10 16:39:43 -0400
commit470716fc043aba2fea832334e58d5cd5d82288a3 (patch)
treeafb68062e20a7de1b092ad8fd2cdb149e572ffd5 /kernel/rcutree.c
parentd34ea3221a0f34ed42eadabf054604bbcc7ecd27 (diff)
rcu: Switch callers from rcu_process_gp_end() to note_gp_changes()
Because note_gp_changes() now incorporates rcu_process_gp_end() function, this commit switches to the former and eliminates the latter. In addition, this commit changes external calls from __rcu_process_gp_end() to __note_gp_changes(). Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 7eb2bc95300a..b04f134ab8bc 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1344,28 +1344,6 @@ static void note_gp_changes(struct rcu_state *rsp, struct rcu_data *rdp)
1344} 1344}
1345 1345
1346/* 1346/*
1347 * Advance this CPU's callbacks, but only if the current grace period
1348 * has ended. This may be called only from the CPU to whom the rdp
1349 * belongs.
1350 */
1351static void
1352rcu_process_gp_end(struct rcu_state *rsp, struct rcu_data *rdp)
1353{
1354 unsigned long flags;
1355 struct rcu_node *rnp;
1356
1357 local_irq_save(flags);
1358 rnp = rdp->mynode;
1359 if (rdp->completed == ACCESS_ONCE(rnp->completed) || /* outside lock. */
1360 !raw_spin_trylock(&rnp->lock)) { /* irqs already off, so later. */
1361 local_irq_restore(flags);
1362 return;
1363 }
1364 __rcu_process_gp_end(rsp, rnp, rdp);
1365 raw_spin_unlock_irqrestore(&rnp->lock, flags);
1366}
1367
1368/*
1369 * Did someone else start a new RCU grace period start since we last 1347 * Did someone else start a new RCU grace period start since we last
1370 * checked? Update local state appropriately if so. Must be called 1348 * checked? Update local state appropriately if so. Must be called
1371 * on the CPU corresponding to rdp. 1349 * on the CPU corresponding to rdp.
@@ -1393,9 +1371,6 @@ check_for_new_grace_period(struct rcu_state *rsp, struct rcu_data *rdp)
1393static void 1371static void
1394rcu_start_gp_per_cpu(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_data *rdp) 1372rcu_start_gp_per_cpu(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_data *rdp)
1395{ 1373{
1396 /* Prior grace period ended, so advance callbacks for current CPU. */
1397 __rcu_process_gp_end(rsp, rnp, rdp);
1398
1399 /* Set state so that this CPU will detect the next quiescent state. */ 1374 /* Set state so that this CPU will detect the next quiescent state. */
1400 __note_gp_changes(rsp, rnp, rdp); 1375 __note_gp_changes(rsp, rnp, rdp);
1401} 1376}
@@ -1531,7 +1506,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
1531 ACCESS_ONCE(rnp->completed) = rsp->gpnum; 1506 ACCESS_ONCE(rnp->completed) = rsp->gpnum;
1532 rdp = this_cpu_ptr(rsp->rda); 1507 rdp = this_cpu_ptr(rsp->rda);
1533 if (rnp == rdp->mynode) 1508 if (rnp == rdp->mynode)
1534 __rcu_process_gp_end(rsp, rnp, rdp); 1509 __note_gp_changes(rsp, rnp, rdp);
1535 nocb += rcu_future_gp_cleanup(rsp, rnp); 1510 nocb += rcu_future_gp_cleanup(rsp, rnp);
1536 raw_spin_unlock_irq(&rnp->lock); 1511 raw_spin_unlock_irq(&rnp->lock);
1537 cond_resched(); 1512 cond_resched();
@@ -2276,7 +2251,7 @@ __rcu_process_callbacks(struct rcu_state *rsp)
2276 WARN_ON_ONCE(rdp->beenonline == 0); 2251 WARN_ON_ONCE(rdp->beenonline == 0);
2277 2252
2278 /* Handle the end of a grace period that some other CPU ended. */ 2253 /* Handle the end of a grace period that some other CPU ended. */
2279 rcu_process_gp_end(rsp, rdp); 2254 note_gp_changes(rsp, rdp);
2280 2255
2281 /* Update RCU state based on any recent quiescent states. */ 2256 /* Update RCU state based on any recent quiescent states. */
2282 rcu_check_quiescent_state(rsp, rdp); 2257 rcu_check_quiescent_state(rsp, rdp);
@@ -2362,7 +2337,7 @@ static void __call_rcu_core(struct rcu_state *rsp, struct rcu_data *rdp,
2362 if (unlikely(rdp->qlen > rdp->qlen_last_fqs_check + qhimark)) { 2337 if (unlikely(rdp->qlen > rdp->qlen_last_fqs_check + qhimark)) {
2363 2338
2364 /* Are we ignoring a completed grace period? */ 2339 /* Are we ignoring a completed grace period? */
2365 rcu_process_gp_end(rsp, rdp); 2340 note_gp_changes(rsp, rdp);
2366 check_for_new_grace_period(rsp, rdp); 2341 check_for_new_grace_period(rsp, rdp);
2367 2342
2368 /* Start a new grace period if one not already started. */ 2343 /* Start a new grace period if one not already started. */