Skip to content

Commit 56823e9

Browse files
paulmckrcufbq
authored andcommitted
doc: Clarify use of slab constructors and SLAB_TYPESAFE_BY_RCU
This commit explicitly states that you should initialize any locks to be used by readers in your SLAB_TYPESAFE_BY_RCU constructor. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 3b239b3 commit 56823e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Documentation/RCU/whatisRCU.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,8 @@ unfortunately any spinlock in a ``SLAB_TYPESAFE_BY_RCU`` object must be
963963
initialized after each and every call to kmem_cache_alloc(), which renders
964964
reference-free spinlock acquisition completely unsafe. Therefore, when
965965
using ``SLAB_TYPESAFE_BY_RCU``, make proper use of a reference counter.
966-
(Those willing to use a kmem_cache constructor may also use locking,
967-
including cache-friendly sequence locking.)
966+
(Those willing to initialize their locks in a kmem_cache constructor
967+
may also use locking, including cache-friendly sequence locking.)
968968

969969
With traditional reference counting -- such as that implemented by the
970970
kref library in Linux -- there is typically code that runs when the last

0 commit comments

Comments
 (0)