aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupdate.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-03-03 17:57:58 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-05-27 15:56:15 -0400
commit7d0ae8086b828311250c6afdf800b568ac9bd693 (patch)
treea1bb0c6a5e66f1e48c4667fd247a41c4b9253fd2 /include/linux/rcupdate.h
parent030bbdbf4c833bc69f502eae58498bc5572db736 (diff)
rcu: Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE()
This commit moves from the old ACCESS_ONCE() API to the new READ_ONCE() and WRITE_ONCE() APIs. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> [ paulmck: Updated to include kernel/torture.c as suggested by Jason Low. ]
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r--include/linux/rcupdate.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 573a5afd5ed8..87bb0eee665b 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -364,8 +364,8 @@ extern struct srcu_struct tasks_rcu_exit_srcu;
364#define rcu_note_voluntary_context_switch(t) \ 364#define rcu_note_voluntary_context_switch(t) \
365 do { \ 365 do { \
366 rcu_all_qs(); \ 366 rcu_all_qs(); \
367 if (ACCESS_ONCE((t)->rcu_tasks_holdout)) \ 367 if (READ_ONCE((t)->rcu_tasks_holdout)) \
368 ACCESS_ONCE((t)->rcu_tasks_holdout) = false; \ 368 WRITE_ONCE((t)->rcu_tasks_holdout, false); \
369 } while (0) 369 } while (0)
370#else /* #ifdef CONFIG_TASKS_RCU */ 370#else /* #ifdef CONFIG_TASKS_RCU */
371#define TASKS_RCU(x) do { } while (0) 371#define TASKS_RCU(x) do { } while (0)
@@ -609,7 +609,7 @@ static inline void rcu_preempt_sleep_check(void)
609 609
610#define __rcu_access_pointer(p, space) \ 610#define __rcu_access_pointer(p, space) \
611({ \ 611({ \
612 typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ 612 typeof(*p) *_________p1 = (typeof(*p) *__force)READ_ONCE(p); \
613 rcu_dereference_sparse(p, space); \ 613 rcu_dereference_sparse(p, space); \
614 ((typeof(*p) __force __kernel *)(_________p1)); \ 614 ((typeof(*p) __force __kernel *)(_________p1)); \
615}) 615})
@@ -630,7 +630,7 @@ static inline void rcu_preempt_sleep_check(void)
630 630
631#define __rcu_access_index(p, space) \ 631#define __rcu_access_index(p, space) \
632({ \ 632({ \
633 typeof(p) _________p1 = ACCESS_ONCE(p); \ 633 typeof(p) _________p1 = READ_ONCE(p); \
634 rcu_dereference_sparse(p, space); \ 634 rcu_dereference_sparse(p, space); \
635 (_________p1); \ 635 (_________p1); \
636}) 636})
@@ -659,7 +659,7 @@ static inline void rcu_preempt_sleep_check(void)
659 */ 659 */
660#define lockless_dereference(p) \ 660#define lockless_dereference(p) \
661({ \ 661({ \
662 typeof(p) _________p1 = ACCESS_ONCE(p); \ 662 typeof(p) _________p1 = READ_ONCE(p); \
663 smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ 663 smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
664 (_________p1); \ 664 (_________p1); \
665}) 665})
@@ -702,7 +702,7 @@ static inline void rcu_preempt_sleep_check(void)
702 * @p: The pointer to read 702 * @p: The pointer to read
703 * 703 *
704 * Return the value of the specified RCU-protected pointer, but omit the 704 * Return the value of the specified RCU-protected pointer, but omit the
705 * smp_read_barrier_depends() and keep the ACCESS_ONCE(). This is useful 705 * smp_read_barrier_depends() and keep the READ_ONCE(). This is useful
706 * when the value of this pointer is accessed, but the pointer is not 706 * when the value of this pointer is accessed, but the pointer is not
707 * dereferenced, for example, when testing an RCU-protected pointer against 707 * dereferenced, for example, when testing an RCU-protected pointer against
708 * NULL. Although rcu_access_pointer() may also be used in cases where 708 * NULL. Although rcu_access_pointer() may also be used in cases where
@@ -791,7 +791,7 @@ static inline void rcu_preempt_sleep_check(void)
791 * @p: The index to read 791 * @p: The index to read
792 * 792 *
793 * Return the value of the specified RCU-protected index, but omit the 793 * Return the value of the specified RCU-protected index, but omit the
794 * smp_read_barrier_depends() and keep the ACCESS_ONCE(). This is useful 794 * smp_read_barrier_depends() and keep the READ_ONCE(). This is useful
795 * when the value of this index is accessed, but the index is not 795 * when the value of this index is accessed, but the index is not
796 * dereferenced, for example, when testing an RCU-protected index against 796 * dereferenced, for example, when testing an RCU-protected index against
797 * -1. Although rcu_access_index() may also be used in cases where 797 * -1. Although rcu_access_index() may also be used in cases where
@@ -827,7 +827,7 @@ static inline void rcu_preempt_sleep_check(void)
827 * @c: The conditions under which the dereference will take place 827 * @c: The conditions under which the dereference will take place
828 * 828 *
829 * Return the value of the specified RCU-protected pointer, but omit 829 * Return the value of the specified RCU-protected pointer, but omit
830 * both the smp_read_barrier_depends() and the ACCESS_ONCE(). This 830 * both the smp_read_barrier_depends() and the READ_ONCE(). This
831 * is useful in cases where update-side locks prevent the value of the 831 * is useful in cases where update-side locks prevent the value of the
832 * pointer from changing. Please note that this primitive does -not- 832 * pointer from changing. Please note that this primitive does -not-
833 * prevent the compiler from repeating this reference or combining it 833 * prevent the compiler from repeating this reference or combining it