rcu: Mark writes to rcu_sync ->gp_count field
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 8 Mar 2024 04:11:21 +0000 (20:11 -0800)
committerUladzislau Rezki (Sony) <urezki@gmail.com>
Mon, 15 Apr 2024 14:28:46 +0000 (16:28 +0200)
commita542d116bab28b4bcade2f41488f4617373c620f
treef0556d1ed06a432bc609ccdb7697ae47a30facae
parentc90b9e49782424623e0006abbcab98f835c1f1d8
rcu: Mark writes to rcu_sync ->gp_count field

The rcu_sync structure's ->gp_count field is updated under the protection
of ->rss_lock, but read locklessly, and KCSAN noted the data race.
This commit therefore uses WRITE_ONCE() to do this update to clearly
document its racy nature.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
kernel/rcu/sync.c