summaryrefslogtreecommitdiffstats
path: root/lib/dec_and_lock.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2017-06-09 13:05:06 +0200
committerIngo Molnar <mingo@kernel.org>2017-08-10 12:28:54 +0200
commit9d664c0aec3bfdb77fcf7de61cfe1febbecdd389 (patch)
tree58c96472de25e0ebcbf2f47b7a53d262edcb3e94 /lib/dec_and_lock.c
parent35a2897c2a306cca344ca5c0b43416707018f434 (diff)
downloadlinux-stable-9d664c0aec3bfdb77fcf7de61cfe1febbecdd389.tar.gz
linux-stable-9d664c0aec3bfdb77fcf7de61cfe1febbecdd389.tar.bz2
linux-stable-9d664c0aec3bfdb77fcf7de61cfe1febbecdd389.zip
locking/atomic: Fix atomic_set_release() for 'funny' architectures
Those architectures that have a special atomic_set implementation also need a special atomic_set_release(), because for the very same reason WRITE_ONCE() is broken for them, smp_store_release() is too. The vast majority is architectures that have spinlock hash based atomic implementation except hexagon which seems to have a hardware 'feature'. The spinlock based atomics should be SC, that is, none of them appear to place extra barriers in atomic_cmpxchg() or any of the other SC atomic primitives and therefore seem to rely on their spinlock implementation being SC (I did not fully validate all that). Therefore, the normal atomic_set() is SC and can be used at atomic_set_release(). Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Chris Metcalf <cmetcalf@mellanox.com> [for tile] Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: davem@davemloft.net Cc: james.hogan@imgtec.com Cc: jejb@parisc-linux.org Cc: rkuo@codeaurora.org Cc: vgupta@synopsys.com Link: http://lkml.kernel.org/r/20170609110506.yod47flaav3wgoj5@hirez.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/dec_and_lock.c')
0 files changed, 0 insertions, 0 deletions