srcu: Make Tree SRCU able to operate without snp_node array
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 24 Jan 2022 17:46:57 +0000 (09:46 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 8 Feb 2022 18:18:44 +0000 (10:18 -0800)
commit9c7ef4c30f120df15aee393b07e6b35554a06fbd
treed374ae34adfef957fcdf63af8e88fc1342e8d77f
parent010d3077d17bd865181a0bc04cb500ff29eda555
srcu: Make Tree SRCU able to operate without snp_node array

This commit makes Tree SRCU able to operate without an snp_node
array, that is, when the srcu_data structures' ->mynode pointers
are NULL.  This can result in high contention on the srcu_struct
structure's ->lock, but only when there are lots of call_srcu(),
synchronize_srcu(), and synchronize_srcu_expedited() calls.

Note that when there is no snp_node array, all SRCU callbacks use
CPU 0's callback queue.  This is optimal in the common case of low
update-side load because it removes the need to search each CPU
for the single callback that made the grace period happen.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
include/linux/srcutree.h
kernel/rcu/srcutree.c