rcu/kvfree: Move need_offload_krc() out of krcp->lock
authorUladzislau Rezki (Sony) <urezki@gmail.com>
Tue, 29 Nov 2022 15:58:21 +0000 (16:58 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 4 Jan 2023 01:48:41 +0000 (17:48 -0800)
commit8fc5494ad5face62747a3937db66b00db1e5d80b
treedb67cb2fdc0efa66885c3c7dad99ba8a2e5a8a11
parent8c15a9e8086508962b2b69456ed22dc517d91b15
rcu/kvfree: Move need_offload_krc() out of krcp->lock

The need_offload_krc() function currently holds the krcp->lock in order
to safely check krcp->head.  This commit removes the need for this lock
in that function by updating the krcp->head pointer using WRITE_ONCE()
macro so that readers can carry out lockless loads of that pointer.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c