Skip to content

Commit 654db05

Browse files
committed
rcu: Use data_race() for RCU expedited CPU stall-warning prints
Although the accesses used to determine whether or not an expedited stall should be printed are an integral part of the concurrency algorithm governing use of the corresponding variables, the values that are simply printed are ancillary. As such, it is best to use data_race() for these accesses in order to provide the greatest latitude in the use of KCSAN for the other accesses that are an integral part of the algorithm. This commit therefore changes the relevant uses of READ_ONCE() to data_race(). Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 3531593 commit 654db05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/rcu/tree_exp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ static void synchronize_rcu_expedited_wait(void)
542542
}
543543
pr_cont(" } %lu jiffies s: %lu root: %#lx/%c\n",
544544
jiffies - jiffies_start, rcu_state.expedited_sequence,
545-
READ_ONCE(rnp_root->expmask),
546-
".T"[!!rnp_root->exp_tasks]);
545+
data_race(rnp_root->expmask),
546+
".T"[!!data_race(rnp_root->exp_tasks)]);
547547
if (ndetected) {
548548
pr_err("blocking rcu_node structures:");
549549
rcu_for_each_node_breadth_first(rnp) {
@@ -553,8 +553,8 @@ static void synchronize_rcu_expedited_wait(void)
553553
continue;
554554
pr_cont(" l=%u:%d-%d:%#lx/%c",
555555
rnp->level, rnp->grplo, rnp->grphi,
556-
READ_ONCE(rnp->expmask),
557-
".T"[!!rnp->exp_tasks]);
556+
data_race(rnp->expmask),
557+
".T"[!!data_race(rnp->exp_tasks)]);
558558
}
559559
pr_cont("\n");
560560
}

0 commit comments

Comments
 (0)