Skip to content

Commit 9aed3b5

Browse files
paulmckrcuNeeraj Upadhyay
authored andcommitted
rcu: Better define "atomic" for list replacement
The kernel-doc headers for list_replace_rcu() and hlist_replace_rcu() claim that the replacement is atomic, which it is, but only for readers. Avoid confusion by making it clear that the atomic nature of these functions applies only to readers, not to concurrent updaters. Signed-off-by: Paul E. McKenney <[email protected]> Signed-off-by: Neeraj Upadhyay <[email protected]>
1 parent 3471e96 commit 9aed3b5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

include/linux/rculist.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ static inline void hlist_del_init_rcu(struct hlist_node *n)
191191
* @old : the element to be replaced
192192
* @new : the new element to insert
193193
*
194-
* The @old entry will be replaced with the @new entry atomically.
194+
* The @old entry will be replaced with the @new entry atomically from
195+
* the perspective of concurrent readers. It is the caller's responsibility
196+
* to synchronize with concurrent updaters, if any.
197+
*
195198
* Note: @old should not be empty.
196199
*/
197200
static inline void list_replace_rcu(struct list_head *old,
@@ -519,7 +522,9 @@ static inline void hlist_del_rcu(struct hlist_node *n)
519522
* @old : the element to be replaced
520523
* @new : the new element to insert
521524
*
522-
* The @old entry will be replaced with the @new entry atomically.
525+
* The @old entry will be replaced with the @new entry atomically from
526+
* the perspective of concurrent readers. It is the caller's responsibility
527+
* to synchronize with concurrent updaters, if any.
523528
*/
524529
static inline void hlist_replace_rcu(struct hlist_node *old,
525530
struct hlist_node *new)

0 commit comments

Comments
 (0)