Skip to content
Commit 71042606 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

srcu: Hold srcu_struct ->lock when updating ->srcu_gp_seq



A read of the srcu_struct structure's ->srcu_gp_seq field should not
need READ_ONCE() when that structure's ->lock is held.  Except that this
lock is not always held when updating this field.  This commit therefore
acquires the lock around updates and removes a now-unneeded READ_ONCE().

This data race was reported by KCSAN.

Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
[ paulmck: Switch from READ_ONCE() to lock per Peter Zilstra question. ]
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
parent 39f91504
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment