Skip to content

Commit ac59853

Browse files
pranithpaulmck
authored andcommitted
rcupdate: Replace smp_read_barrier_depends() with lockless_dereference()
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
1 parent 536fa40 commit ac59853

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/linux/rcupdate.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,11 @@ static inline void rcu_preempt_sleep_check(void)
582582
})
583583
#define __rcu_dereference_check(p, c, space) \
584584
({ \
585-
typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \
585+
/* Dependency order vs. p above. */ \
586+
typeof(*p) *________p1 = (typeof(*p) *__force)lockless_dereference(p); \
586587
rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \
587588
rcu_dereference_sparse(p, space); \
588-
smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
589-
((typeof(*p) __force __kernel *)(_________p1)); \
589+
((typeof(*p) __force __kernel *)(________p1)); \
590590
})
591591
#define __rcu_dereference_protected(p, c, space) \
592592
({ \
@@ -603,10 +603,10 @@ static inline void rcu_preempt_sleep_check(void)
603603
})
604604
#define __rcu_dereference_index_check(p, c) \
605605
({ \
606-
typeof(p) _________p1 = ACCESS_ONCE(p); \
606+
/* Dependency order vs. p above. */ \
607+
typeof(p) _________p1 = lockless_dereference(p); \
607608
rcu_lockdep_assert(c, \
608609
"suspicious rcu_dereference_index_check() usage"); \
609-
smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
610610
(_________p1); \
611611
})
612612

0 commit comments

Comments
 (0)