locking/barriers: Convert users of lockless_dereference() to READ_ONCE()
READ_ONCE() now has an implicit smp_read_barrier_depends() call, so it can be used instead of lockless_dereference() without any change in semantics. Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1508840570-22169-4-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -274,7 +274,7 @@ static inline void list_splice_tail_init_rcu(struct list_head *list,
|
||||
* primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
|
||||
*/
|
||||
#define list_entry_rcu(ptr, type, member) \
|
||||
container_of(lockless_dereference(ptr), type, member)
|
||||
container_of(READ_ONCE(ptr), type, member)
|
||||
|
||||
/*
|
||||
* Where are list_empty_rcu() and list_first_entry_rcu()?
|
||||
@@ -367,7 +367,7 @@ static inline void list_splice_tail_init_rcu(struct list_head *list,
|
||||
* example is when items are added to the list, but never deleted.
|
||||
*/
|
||||
#define list_entry_lockless(ptr, type, member) \
|
||||
container_of((typeof(ptr))lockless_dereference(ptr), type, member)
|
||||
container_of((typeof(ptr))READ_ONCE(ptr), type, member)
|
||||
|
||||
/**
|
||||
* list_for_each_entry_lockless - iterate over rcu list of given type
|
||||
|
Reference in New Issue
Block a user