rcu: Remove redundant READ_ONCE() of rcu_state.gp_flags in tree.c
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 7 Mar 2024 23:01:54 +0000 (15:01 -0800)
committerUladzislau Rezki (Sony) <urezki@gmail.com>
Mon, 15 Apr 2024 11:07:14 +0000 (13:07 +0200)
commit62bb24c4b022b9ba9cf2e4a72f6cd8c3086f0cf8
tree3e860e809c6d94bb8370b19c0d140bd251bf12d6
parent11b8b378c58bdaf076c2724bee03157e3160af5f
rcu: Remove redundant READ_ONCE() of rcu_state.gp_flags in tree.c

Although it is functionally OK to do READ_ONCE() of a variable that
cannot change, it is confusing and at best an accident waiting to happen.
This commit therefore removes a number of READ_ONCE(rcu_state.gp_flags)
instances from kernel/rcu/tree.c that are not needed due to updates
to this field being excluded by virtue of holding the root rcu_node
structure's ->lock.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Closes: https://lore.kernel.org/lkml/4857c5ef-bd8f-4670-87ac-0600a1699d05@paulmck-laptop/T/#mccb23c2a4902da4d3c750165329f8de056903c58
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/lkml/4857c5ef-bd8f-4670-87ac-0600a1699d05@paulmck-laptop/T/#md1b5c026584f9c3c7b0fbc9240dd7de584597b73
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
kernel/rcu/tree.c