aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWill Deacon <[email protected]>2017-10-24 11:22:47 +0100
committerIngo Molnar <[email protected]>2017-10-24 13:17:32 +0200
commit76ebbe78f7390aee075a7f3768af197ded1bdfbb (patch)
tree531d3794d965b8e4e8107d8dbd1b124cbf3dbca5 /include
parentd15155824c5014803d91b829736d249c500bdda6 (diff)
locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
In preparation for the removal of lockless_dereference(), which is the same as READ_ONCE() on all architectures other than Alpha, add an implicit smp_read_barrier_depends() to READ_ONCE() so that it can be used to head dependency chains on all architectures. Signed-off-by: Will Deacon <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/linux/compiler.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 08083186e54f..7d7b77da9716 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -242,6 +242,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
__read_once_size(&(x), __u.__c, sizeof(x)); \
else \
__read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
+ smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \
__u.__val; \
})
#define READ_ONCE(x) __READ_ONCE(x, 1)