doc: SLAB_TYPESAFE_BY_RCU uses cannot rely on spinlocks
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 9 Aug 2022 17:24:36 +0000 (10:24 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 31 Aug 2022 11:58:15 +0000 (04:58 -0700)
commit99cf092058e13f133ff9373fcbd25ae38509df03
tree8c5a3e700b8a1059316be2183b582bb3fe8a2a5f
parent022d1b356c8a687a58a74cbc90a92d56d3aa207d
doc: SLAB_TYPESAFE_BY_RCU uses cannot rely on spinlocks

Because the SLAB_TYPESAFE_BY_RCU code does not zero pages that are
to be broken up into slabs, the memory returned by kmem_cache_alloc()
must be fully initialized, including any spinlocks included in the newly
allocated structure.  This means that readers attempting to look up an
SLAB_TYPESAFE_BY_RCU object must use a reference-counting approach.
A spinlock may be acquired only after a reference is obtained, which
prevents that object from being passed to kmem_struct_free(), but only
while that reference continues to be held.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Documentation/RCU/whatisRCU.rst