mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
rcu: Use READ_ONCE() for lockless read of rnp->qsmask
The rnp->qsmask is locklessly accessed from rcutree_dying_cpu(). This may help avoid load tearing due to concurrent access, KCSAN issues, and preserve sanity of people reading the mask in tracing. Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
b5ad0d2e88
commit
aba9645bd1
1 changed files with 1 additions and 1 deletions
|
@ -2106,7 +2106,7 @@ int rcutree_dying_cpu(unsigned int cpu)
|
||||||
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
|
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
blkd = !!(rnp->qsmask & rdp->grpmask);
|
blkd = !!(READ_ONCE(rnp->qsmask) & rdp->grpmask);
|
||||||
trace_rcu_grace_period(rcu_state.name, READ_ONCE(rnp->gp_seq),
|
trace_rcu_grace_period(rcu_state.name, READ_ONCE(rnp->gp_seq),
|
||||||
blkd ? TPS("cpuofl-bgp") : TPS("cpuofl"));
|
blkd ? TPS("cpuofl-bgp") : TPS("cpuofl"));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue