aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/barrier.h
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2015-09-11 16:32:24 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-10-14 14:32:01 +0200
commit1afc82aee45c118dc8026d54a230e75ff6baee66 (patch)
treeb478e20ec24f9b55ee3471978213513cb426bc4f /arch/s390/include/asm/barrier.h
parents390/vdso: use correct memory barrier (diff)
downloadlinux-dev-1afc82aee45c118dc8026d54a230e75ff6baee66.tar.xz
linux-dev-1afc82aee45c118dc8026d54a230e75ff6baee66.zip
s390/barrier: avoid serialization in [smp_]rmb and [smp_]wmb
The principles of operation says: The storage-operand fetch references of one instruction occur after those of all preceding instructions and before those of subsequent instructions, as observed by other CPUs and by channel programs. [...] The CPU may fetch the operands of instructions before the instructions are executed. [...] The CPU may delay placing results in storage. [...] the results of one instruction are placed in storage after the results of all preceding instructions have been placed in storage and before any results of the succeeding instructions are stored, as observed by other CPUs and by the channel subsystem. which boils down to: - reads are in order - writes are in order - reads can happen earlier - writes can happen later By definition (see memory-barrier.txt) read barriers orders reads vs reads and write barriers orders writes agains writes. but neither of these orders reads vs. writes. That means we can implement smp_wmb,smp_rmb,wmb and rmb as simple compiler barriers. To avoid reviewing all driver code for correct barrier usage we keep dma_[rw]mb as serialization for now. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/barrier.h')
-rw-r--r--arch/s390/include/asm/barrier.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h
index d48fe0162331..d68e11e0df5e 100644
--- a/arch/s390/include/asm/barrier.h
+++ b/arch/s390/include/asm/barrier.h
@@ -22,10 +22,10 @@
#define mb() do { asm volatile(__ASM_BARRIER : : : "memory"); } while (0)
-#define rmb() mb()
-#define wmb() mb()
-#define dma_rmb() rmb()
-#define dma_wmb() wmb()
+#define rmb() barrier()
+#define wmb() barrier()
+#define dma_rmb() mb()
+#define dma_wmb() mb()
#define smp_mb() mb()
#define smp_rmb() rmb()
#define smp_wmb() wmb()