rcu: Add READ_ONCE() to rcu_data ->gpwrap
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 7 Jan 2020 23:48:39 +0000 (15:48 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 20 Feb 2020 23:58:22 +0000 (15:58 -0800)
commita5b8950180f8e5acb802d1672e0b4d0ceee6126e
treefa0f8d7e3bd76c2db2df2c59d818c6b2f8def89c
parent65bb0dc437c3e57a6cde2b81170c8af4b9c90735
rcu: Add READ_ONCE() to rcu_data ->gpwrap

The rcu_data structure's ->gpwrap field is read locklessly, and so
this commit adds the required READ_ONCE() to a pair of laods in order
to avoid destructive compiler optimizations.

This data race was reported by KCSAN.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c
kernel/rcu/tree_stall.h