Skip to content
Commit 99cf0920 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

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: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 022d1b35
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment