srcu: Move ->lock initialization after srcu_usage allocation
authorPaul E. McKenney <paulmck@kernel.org>
Sat, 18 Mar 2023 00:35:21 +0000 (17:35 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 4 Apr 2023 15:36:01 +0000 (08:36 -0700)
commit0839ade94bdef395bab02b3a579416c112062026
treedfc3d4a9a646915277fdcfaaed827c4bbfa1b99d
parent574dc1a7efe490dffe5c1ce0285306feec16a880
srcu: Move ->lock initialization after srcu_usage allocation

Currently, both __init_srcu_struct() in CONFIG_DEBUG_LOCK_ALLOC=y kernels
and init_srcu_struct() in CONFIG_DEBUG_LOCK_ALLOC=n kernel initialize
the srcu_struct structure's ->lock before the srcu_usage structure has
been allocated.  This of course prevents the ->lock from being moved
to the srcu_usage structure, so this commit moves the initialization
into the init_srcu_struct_fields() after the srcu_usage structure has
been allocated.

Cc: Christoph Hellwig <hch@lst.de>
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Tested-by: "Zhang, Qiang1" <qiang1.zhang@intel.com>
Tested-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/srcutree.c