aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar <bobby.prani@gmail.com>2014-11-13 14:24:14 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-01-06 14:01:11 -0500
commitac59853c06993a442e8060bc19040b2ca3025aec (patch)
tree3e4b978a2a005e85f1b59ce2754dda28f203778a
parent536fa402221f09633e7c5801b327055ab716a363 (diff)
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>
-rw-r--r--include/linux/rcupdate.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index ed4f5939a452..386ba288084a 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -582,11 +582,11 @@ static inline void rcu_preempt_sleep_check(void)
582}) 582})
583#define __rcu_dereference_check(p, c, space) \ 583#define __rcu_dereference_check(p, c, space) \
584({ \ 584({ \
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); \
586 rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ 587 rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \
587 rcu_dereference_sparse(p, space); \ 588 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)); \
590}) 590})
591#define __rcu_dereference_protected(p, c, space) \ 591#define __rcu_dereference_protected(p, c, space) \
592({ \ 592({ \
@@ -603,10 +603,10 @@ static inline void rcu_preempt_sleep_check(void)
603}) 603})
604#define __rcu_dereference_index_check(p, c) \ 604#define __rcu_dereference_index_check(p, c) \
605({ \ 605({ \
606 typeof(p) _________p1 = ACCESS_ONCE(p); \ 606 /* Dependency order vs. p above. */ \
607 typeof(p) _________p1 = lockless_dereference(p); \
607 rcu_lockdep_assert(c, \ 608 rcu_lockdep_assert(c, \
608 "suspicious rcu_dereference_index_check() usage"); \ 609 "suspicious rcu_dereference_index_check() usage"); \
609 smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
610 (_________p1); \ 610 (_________p1); \
611}) 611})
612 612