diff options
| author | Paul E. McKenney <[email protected]> | 2013-08-23 16:40:42 +0000 |
|---|---|---|
| committer | Paul E. McKenney <[email protected]> | 2013-09-23 16:13:49 +0000 |
| commit | 2a855b644c310d5db5a80b8816c0c7748c167977 (patch) | |
| tree | c39eb7a56033c40a380b45b8928ab377722e6b02 /lib/spinlock_debug.c | |
| parent | rcu: Fix dubious "if" condition in __call_rcu_nocb_enqueue() (diff) | |
| download | kernel-2a855b644c310d5db5a80b8816c0c7748c167977.tar.gz kernel-2a855b644c310d5db5a80b8816c0c7748c167977.zip | |
rcu: Make list_splice_init_rcu() account for RCU readers
The list_splice_init_rcu() function allows a list visible to RCU readers
to be spliced into another list visible to RCU readers. This is OK,
except for the use of INIT_LIST_HEAD(), which does pointer updates
without doing anything to make those updates safe for concurrent readers.
Of course, most of the time INIT_LIST_HEAD() is being used in reader-free
contexts, such as initialization or cleanup, so it is OK for it to update
pointers in an unsafe-for-RCU-readers manner. This commit therefore
creates an INIT_LIST_HEAD_RCU() that uses ACCESS_ONCE() to make the updates
reader-safe. The reason that we can use ACCESS_ONCE() instead of the more
typical rcu_assign_pointer() is that list_splice_init_rcu() is updating the
pointers to reference something that is already visible to readers, so
that there is no problem with pre-initialized values.
Signed-off-by: Paul E. McKenney <[email protected]>
Diffstat (limited to 'lib/spinlock_debug.c')
0 files changed, 0 insertions, 0 deletions
