Skip to content

Commit

Permalink
s390/barrier: remove unnecessary serialization in atomics and bitops
Browse files Browse the repository at this point in the history
The principles of operation states reads are in order, writes are in
order, writes can be reordered after reads, but no reads can be
reordered after writes.

The atomic and bitops variantes for z196 use the interlocked-access
facility instructions with a memory barrier before and after the
instruction. Because of the memory ordering the first barrier is
unnecessary and can be removed.

Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky committed Oct 14, 2015
1 parent b5a6b71 commit 5da7667
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions arch/s390/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
\
typecheck(atomic_t *, ptr); \
asm volatile( \
__barrier \
op_string " %0,%2,%1\n" \
__barrier \
: "=d" (old_val), "+Q" ((ptr)->counter) \
Expand Down Expand Up @@ -180,7 +179,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
\
typecheck(atomic64_t *, ptr); \
asm volatile( \
__barrier \
op_string " %0,%2,%1\n" \
__barrier \
: "=d" (old_val), "+Q" ((ptr)->counter) \
Expand Down
1 change: 0 additions & 1 deletion arch/s390/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
\
typecheck(unsigned long *, (__addr)); \
asm volatile( \
__barrier \
__op_string " %0,%2,%1\n" \
__barrier \
: "=d" (__old), "+Q" (*(__addr)) \
Expand Down

0 comments on commit 5da7667

Please sign in to comment.