diff options
author | SeongJae Park <sj@kernel.org> | 2023-06-16 23:36:24 +0000 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2023-07-14 14:55:56 -0700 |
commit | 5326caa7a147743340f68b5b7ed4c2a91b4abb56 (patch) | |
tree | 555be9329d1d8a4a6ddc2240431911a56688a987 /Documentation/RCU | |
parent | 674dd365736125b56297aaea8845a90e5ea990b9 (diff) |
Docs/RCU/rculist_nulls: Specify type of the object in examples
The type of 'obj' in example code of rculist_nulls.rst is implicit.
Provide the specific type of it before the example code.
Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/rcu/43943609-f80c-4b6a-9844-994eef800757@paulmck-laptop/
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'Documentation/RCU')
-rw-r--r-- | Documentation/RCU/rculist_nulls.rst | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst index 4d6f077552ed..479cedfec446 100644 --- a/Documentation/RCU/rculist_nulls.rst +++ b/Documentation/RCU/rculist_nulls.rst @@ -18,7 +18,16 @@ to solve following problem. Without 'nulls', a typical RCU linked list managing objects which are allocated with SLAB_TYPESAFE_BY_RCU kmem_cache can use the following -algorithms: +algorithms. Following examples assume 'obj' is a pointer to such +objects, which is having below type. + +:: + + struct object { + struct hlist_node obj_node; + atomic_t refcnt; + unsigned int key; + }; 1) Lookup algorithm ------------------- @@ -144,6 +153,9 @@ the beginning. If the object was moved to the same chain, then the reader doesn't care: It might occasionally scan the list again without harm. +Note that using hlist_nulls means the type of 'obj_node' field of +'struct object' becomes 'struct hlist_nulls_node'. + 1) lookup algorithm ------------------- |