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

rcu: Describe listRCU read-side guarantees

More explicitly state what is, and what is not guaranteed to those
who iterate a list while protected by RCU.

[ paulmck: Apply Joel Fernandes feedback. ]

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>

authored by

Matthew Wilcox (Oracle) and committed by
Frederic Weisbecker
082acfe3 ebbb9d35

+9
+9
Documentation/RCU/listRCU.rst
··· 8 8 that all of the required memory ordering is provided by the list macros. 9 9 This document describes several list-based RCU use cases. 10 10 11 + When iterating a list while holding the rcu_read_lock(), writers may 12 + modify the list. The reader is guaranteed to see all of the elements 13 + which were added to the list before they acquired the rcu_read_lock() 14 + and are still on the list when they drop the rcu_read_unlock(). 15 + Elements which are added to, or removed from the list may or may not 16 + be seen. If the writer calls list_replace_rcu(), the reader may see 17 + either the old element or the new element; they will not see both, 18 + nor will they see neither. 19 + 11 20 12 21 Example 1: Read-mostly list: Deferred Destruction 13 22 -------------------------------------------------