Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

SeongJae Park and committed by
Paul E. McKenney
5326caa7 674dd365

+13 -1
+13 -1
Documentation/RCU/rculist_nulls.rst
··· 18 18 19 19 Without 'nulls', a typical RCU linked list managing objects which are 20 20 allocated with SLAB_TYPESAFE_BY_RCU kmem_cache can use the following 21 - algorithms: 21 + algorithms. Following examples assume 'obj' is a pointer to such 22 + objects, which is having below type. 23 + 24 + :: 25 + 26 + struct object { 27 + struct hlist_node obj_node; 28 + atomic_t refcnt; 29 + unsigned int key; 30 + }; 22 31 23 32 1) Lookup algorithm 24 33 ------------------- ··· 152 143 the beginning. If the object was moved to the same chain, 153 144 then the reader doesn't care: It might occasionally 154 145 scan the list again without harm. 146 + 147 + Note that using hlist_nulls means the type of 'obj_node' field of 148 + 'struct object' becomes 'struct hlist_nulls_node'. 155 149 156 150 157 151 1) lookup algorithm