Commit 7b2e6011f150c42235c4a541d20cf6891afe878a

Authored by Paul E. McKenney
Committed by Paul E. McKenney
1 parent 489832609a

rcu: Rename ->onofflock to ->orphan_lock

The ->onofflock field in the rcu_state structure at one time synchronized
CPU-hotplug operations for RCU.  However, its scope has decreased over time
so that it now only protects the lists of orphaned RCU callbacks.  This
commit therefore renames it to ->orphan_lock to reflect its current use.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

Showing 3 changed files with 11 additions and 11 deletions Side-by-side Diff

... ... @@ -70,7 +70,7 @@
70 70 .fqs_state = RCU_GP_IDLE, \
71 71 .gpnum = -300, \
72 72 .completed = -300, \
73   - .onofflock = __RAW_SPIN_LOCK_UNLOCKED(&sname##_state.onofflock), \
  73 + .orphan_lock = __RAW_SPIN_LOCK_UNLOCKED(&sname##_state.orphan_lock), \
74 74 .orphan_nxttail = &sname##_state.orphan_nxtlist, \
75 75 .orphan_donetail = &sname##_state.orphan_donelist, \
76 76 .barrier_mutex = __MUTEX_INITIALIZER(sname##_state.barrier_mutex), \
... ... @@ -1573,7 +1573,7 @@
1573 1573 /*
1574 1574 * Send the specified CPU's RCU callbacks to the orphanage. The
1575 1575 * specified CPU must be offline, and the caller must hold the
1576   - * ->onofflock.
  1576 + * ->orphan_lock.
1577 1577 */
1578 1578 static void
1579 1579 rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp,
... ... @@ -1623,7 +1623,7 @@
1623 1623  
1624 1624 /*
1625 1625 * Adopt the RCU callbacks from the specified rcu_state structure's
1626   - * orphanage. The caller must hold the ->onofflock.
  1626 + * orphanage. The caller must hold the ->orphan_lock.
1627 1627 */
1628 1628 static void rcu_adopt_orphan_cbs(struct rcu_state *rsp)
1629 1629 {
... ... @@ -1702,7 +1702,7 @@
1702 1702  
1703 1703 /* Exclude any attempts to start a new grace period. */
1704 1704 mutex_lock(&rsp->onoff_mutex);
1705   - raw_spin_lock_irqsave(&rsp->onofflock, flags);
  1705 + raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
1706 1706  
1707 1707 /* Orphan the dead CPU's callbacks, and adopt them if appropriate. */
1708 1708 rcu_send_cbs_to_orphanage(cpu, rsp, rnp, rdp);
1709 1709  
... ... @@ -1729,10 +1729,10 @@
1729 1729 /*
1730 1730 * We still hold the leaf rcu_node structure lock here, and
1731 1731 * irqs are still disabled. The reason for this subterfuge is
1732   - * because invoking rcu_report_unblock_qs_rnp() with ->onofflock
  1732 + * because invoking rcu_report_unblock_qs_rnp() with ->orphan_lock
1733 1733 * held leads to deadlock.
1734 1734 */
1735   - raw_spin_unlock(&rsp->onofflock); /* irqs remain disabled. */
  1735 + raw_spin_unlock(&rsp->orphan_lock); /* irqs remain disabled. */
1736 1736 rnp = rdp->mynode;
1737 1737 if (need_report & RCU_OFL_TASKS_NORM_GP)
1738 1738 rcu_report_unblock_qs_rnp(rnp, flags);
... ... @@ -383,9 +383,8 @@
383 383  
384 384 /* End of fields guarded by root rcu_node's lock. */
385 385  
386   - raw_spinlock_t onofflock ____cacheline_internodealigned_in_smp;
387   - /* exclude on/offline and */
388   - /* starting new GP. */
  386 + raw_spinlock_t orphan_lock ____cacheline_internodealigned_in_smp;
  387 + /* Protect following fields. */
389 388 struct rcu_head *orphan_nxtlist; /* Orphaned callbacks that */
390 389 /* need a grace period. */
391 390 struct rcu_head **orphan_nxttail; /* Tail of above. */
... ... @@ -394,7 +393,7 @@
394 393 struct rcu_head **orphan_donetail; /* Tail of above. */
395 394 long qlen_lazy; /* Number of lazy callbacks. */
396 395 long qlen; /* Total number of callbacks. */
397   - /* End of fields guarded by onofflock. */
  396 + /* End of fields guarded by orphan_lock. */
398 397  
399 398 struct mutex onoff_mutex; /* Coordinate hotplug & GPs. */
400 399  
kernel/rcutree_plugin.h
... ... @@ -757,7 +757,8 @@
757 757 * grace period for the specified rcu_node structure. If there are no such
758 758 * tasks, report it up the rcu_node hierarchy.
759 759 *
760   - * Caller must hold sync_rcu_preempt_exp_mutex and rsp->onofflock.
  760 + * Caller must hold sync_rcu_preempt_exp_mutex and must exclude
  761 + * CPU hotplug operations.
761 762 */
762 763 static void
763 764 sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp)