Skip to content

Commit 9424b86

Browse files
committed
rcu: Eliminate rcu_implicit_dynticks_qs() local variable ruqp
The rcu_implicit_dynticks_qs() function's local variable ruqp references the ->rcu_urgent_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 couple of lines of code by replacing each instance of ruqp with &rdp->need_heavy_qs. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 88ee23e commit 9424b86

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

kernel/rcu/tree.c

Lines changed: 3 additions & 5 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 *ruqp;
12231222
struct rcu_node *rnp = rdp->mynode;
12241223

12251224
/*
@@ -1284,16 +1283,15 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
12841283
* is set way high.
12851284
*/
12861285
jtsq = READ_ONCE(jiffies_to_sched_qs);
1287-
ruqp = per_cpu_ptr(&rcu_data.rcu_urgent_qs, rdp->cpu);
12881286
if (!READ_ONCE(rdp->rcu_need_heavy_qs) &&
12891287
(time_after(jiffies, rcu_state.gp_start + jtsq * 2) ||
12901288
time_after(jiffies, rcu_state.jiffies_resched) ||
12911289
rcu_state.cbovld)) {
12921290
WRITE_ONCE(rdp->rcu_need_heavy_qs, true);
12931291
/* Store rcu_need_heavy_qs before rcu_urgent_qs. */
1294-
smp_store_release(ruqp, true);
1292+
smp_store_release(&rdp->rcu_urgent_qs, true);
12951293
} else if (time_after(jiffies, rcu_state.gp_start + jtsq)) {
1296-
WRITE_ONCE(*ruqp, true);
1294+
WRITE_ONCE(rdp->rcu_urgent_qs, true);
12971295
}
12981296

12991297
/*
@@ -1307,7 +1305,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
13071305
if (tick_nohz_full_cpu(rdp->cpu) &&
13081306
(time_after(jiffies, READ_ONCE(rdp->last_fqs_resched) + jtsq * 3) ||
13091307
rcu_state.cbovld)) {
1310-
WRITE_ONCE(*ruqp, true);
1308+
WRITE_ONCE(rdp->rcu_urgent_qs, true);
13111309
resched_cpu(rdp->cpu);
13121310
WRITE_ONCE(rdp->last_fqs_resched, jiffies);
13131311
}

0 commit comments

Comments
 (0)