Skip to content

Commit 88ee23e

Browse files
committed
rcu: Eliminate rcu_implicit_dynticks_qs() local variable rnhqp
The rcu_implicit_dynticks_qs() function's local variable rnhqp references the ->rcu_need_heavy_qs field in the rcu_data structure referenced by the function parameter rdp, with a rather odd method for computing the pointer to this field. This commit therefore simplifies things and saves a few lines of code by replacing each instance of rnhqp with &rdp->need_heavy_qs. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 52b030a commit 88ee23e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/rcu/tree.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,6 @@ static int dyntick_save_progress_counter(struct rcu_data *rdp)
12191219
static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
12201220
{
12211221
unsigned long jtsq;
1222-
bool *rnhqp;
12231222
bool *ruqp;
12241223
struct rcu_node *rnp = rdp->mynode;
12251224

@@ -1286,12 +1285,11 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
12861285
*/
12871286
jtsq = READ_ONCE(jiffies_to_sched_qs);
12881287
ruqp = per_cpu_ptr(&rcu_data.rcu_urgent_qs, rdp->cpu);
1289-
rnhqp = per_cpu_ptr(&rcu_data.rcu_need_heavy_qs, rdp->cpu);
1290-
if (!READ_ONCE(*rnhqp) &&
1288+
if (!READ_ONCE(rdp->rcu_need_heavy_qs) &&
12911289
(time_after(jiffies, rcu_state.gp_start + jtsq * 2) ||
12921290
time_after(jiffies, rcu_state.jiffies_resched) ||
12931291
rcu_state.cbovld)) {
1294-
WRITE_ONCE(*rnhqp, true);
1292+
WRITE_ONCE(rdp->rcu_need_heavy_qs, true);
12951293
/* Store rcu_need_heavy_qs before rcu_urgent_qs. */
12961294
smp_store_release(ruqp, true);
12971295
} else if (time_after(jiffies, rcu_state.gp_start + jtsq)) {

0 commit comments

Comments
 (0)