1
0
Fork 0
alistair23-linux/arch
Mark Rutland fd2efaa4eb locking/atomics: Rework ordering barriers
Currently architectures can override __atomic_op_*() to define the barriers
used before/after a relaxed atomic when used to build acquire/release/fence
variants.

This has the unfortunate property of requiring the architecture to define the
full wrapper for the atomics, rather than just the barriers they care about,
and gets in the way of generating atomics which can be easily read.

Instead, this patch has architectures define an optional set of barriers:

* __atomic_acquire_fence()
* __atomic_release_fence()
* __atomic_pre_full_fence()
* __atomic_post_full_fence()

... which <linux/atomic.h> uses to build the wrappers.

It would be nice if we could undef these, along with the __atomic_op_*()
wrappers, but that would break the cmpxchg() wrappers, which are written
in preprocessor. Undefs would have been nice, but alas.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Andrea Parri <parri.andrea@gmail.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: andy.shevchenko@gmail.com
Cc: arnd@arndb.de
Cc: aryabinin@virtuozzo.com
Cc: catalin.marinas@arm.com
Cc: dvyukov@google.com
Cc: glider@google.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: peter@hurleysoftware.com
Link: http://lkml.kernel.org/r/20180716113017.3909-7-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-07-25 11:53:59 +02:00
..
alpha locking/atomics: Rework ordering barriers 2018-07-25 11:53:59 +02:00
arc atomics/treewide: Clean up '*_andnot()' ifdeffery 2018-06-21 14:25:24 +02:00
arm Linux 4.18-rc5 2018-07-17 09:27:43 +02:00
arm64 Linux 4.18-rc5 2018-07-17 09:27:43 +02:00
c6x Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 20:27:54 -07:00
h8300 atomics/treewide: Make unconditional inc/dec ops optional 2018-06-21 14:25:24 +02:00
hexagon atomics/treewide: Make unconditional inc/dec ops optional 2018-06-21 14:25:24 +02:00
ia64 atomics/treewide: Make conditional inc/dec ops optional 2018-06-21 14:25:24 +02:00
m68k Linux 4.18-rc5 2018-07-17 09:27:43 +02:00
microblaze Microblaze patches for 4.18-rc3 2018-06-27 09:49:30 -07:00
mips Linux 4.18-rc5 2018-07-17 09:27:43 +02:00
nds32 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 20:27:54 -07:00
nios2 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 20:27:54 -07:00
openrisc Linux 4.18-rc5 2018-07-17 09:27:43 +02:00
parisc Linux 4.18-rc5 2018-07-17 09:27:43 +02:00
powerpc locking/atomics: Rework ordering barriers 2018-07-25 11:53:59 +02:00
riscv locking/atomics: Rework ordering barriers 2018-07-25 11:53:59 +02:00
s390 Linux 4.18-rc5 2018-07-17 09:27:43 +02:00
sh atomics/treewide: Make unconditional inc/dec ops optional 2018-06-21 14:25:24 +02:00
sparc atomics/treewide: Make conditional inc/dec ops optional 2018-06-21 14:25:24 +02:00
um Solve a series of broken links for files under Documentation: 2018-06-17 05:25:18 +09:00
unicore32 docs: Fix some broken references 2018-06-15 18:10:01 -03:00
x86 locking/atomics: Instrument xchg() 2018-07-25 11:53:59 +02:00
xtensa atomics/treewide: Make unconditional inc/dec ops optional 2018-06-21 14:25:24 +02:00
.gitignore
Kconfig docs: Fix some broken references 2018-06-15 18:10:01 -03:00