mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
rcu: Add WRITE_ONCE() to rcu_state ->gp_req_activity
The rcu_state structure's ->gp_req_activity field is read locklessly, so this commit adds the WRITE_ONCE() to an update in order to provide proper documentation and READ_ONCE()/WRITE_ONCE() pairing. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
0937d04573
commit
2906d2154c
1 changed files with 2 additions and 2 deletions
|
@ -1200,7 +1200,7 @@ static bool rcu_start_this_gp(struct rcu_node *rnp_start, struct rcu_data *rdp,
|
||||||
}
|
}
|
||||||
trace_rcu_this_gp(rnp, rdp, gp_seq_req, TPS("Startedroot"));
|
trace_rcu_this_gp(rnp, rdp, gp_seq_req, TPS("Startedroot"));
|
||||||
WRITE_ONCE(rcu_state.gp_flags, rcu_state.gp_flags | RCU_GP_FLAG_INIT);
|
WRITE_ONCE(rcu_state.gp_flags, rcu_state.gp_flags | RCU_GP_FLAG_INIT);
|
||||||
rcu_state.gp_req_activity = jiffies;
|
WRITE_ONCE(rcu_state.gp_req_activity, jiffies);
|
||||||
if (!rcu_state.gp_kthread) {
|
if (!rcu_state.gp_kthread) {
|
||||||
trace_rcu_this_gp(rnp, rdp, gp_seq_req, TPS("NoGPkthread"));
|
trace_rcu_this_gp(rnp, rdp, gp_seq_req, TPS("NoGPkthread"));
|
||||||
goto unlock_out;
|
goto unlock_out;
|
||||||
|
@ -1775,7 +1775,7 @@ static void rcu_gp_cleanup(void)
|
||||||
rcu_segcblist_is_offloaded(&rdp->cblist);
|
rcu_segcblist_is_offloaded(&rdp->cblist);
|
||||||
if ((offloaded || !rcu_accelerate_cbs(rnp, rdp)) && needgp) {
|
if ((offloaded || !rcu_accelerate_cbs(rnp, rdp)) && needgp) {
|
||||||
WRITE_ONCE(rcu_state.gp_flags, RCU_GP_FLAG_INIT);
|
WRITE_ONCE(rcu_state.gp_flags, RCU_GP_FLAG_INIT);
|
||||||
rcu_state.gp_req_activity = jiffies;
|
WRITE_ONCE(rcu_state.gp_req_activity, jiffies);
|
||||||
trace_rcu_grace_period(rcu_state.name,
|
trace_rcu_grace_period(rcu_state.name,
|
||||||
READ_ONCE(rcu_state.gp_seq),
|
READ_ONCE(rcu_state.gp_seq),
|
||||||
TPS("newreq"));
|
TPS("newreq"));
|
||||||
|
|
Loading…
Reference in a new issue