Skip to content

Commit e2bd168

Browse files
paulmckrcuurezki
authored andcommitted
rcu: Move rcu_report_exp_rdp() setting of ->cpu_no_qs.b.exp under lock
This commit reduces the state space of rcu_report_exp_rdp() by moving the setting of ->cpu_no_qs.b.exp under the rcu_node structure's ->lock. The lock isn't really all that important here, given that this per-CPU field is supposed to be written only by its CPU, but the disabling of interrupts excludes things like rcu_exp_handler(), which also can write to this same field. Avoiding this sort of interleaved access reduces the state space. Signed-off-by: Paul E. McKenney <[email protected]> Cc: Frederic Weisbecker <[email protected]> Signed-off-by: Uladzislau Rezki (Sony) <[email protected]>
1 parent d16e32f commit e2bd168

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/tree_exp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ static void rcu_report_exp_rdp(struct rcu_data *rdp)
260260
unsigned long flags;
261261
struct rcu_node *rnp = rdp->mynode;
262262

263-
WRITE_ONCE(rdp->cpu_no_qs.b.exp, false);
264263
raw_spin_lock_irqsave_rcu_node(rnp, flags);
264+
WRITE_ONCE(rdp->cpu_no_qs.b.exp, false);
265265
rcu_report_exp_cpu_mult(rnp, flags, rdp->grpmask, true);
266266
}
267267

0 commit comments

Comments
 (0)