locking/xchg/alpha: Remove superfluous memory barriers from the _local() variants
authorAndrea Parri <parri.andrea@gmail.com>
Tue, 27 Feb 2018 04:00:58 +0000 (05:00 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 12 Mar 2018 09:59:03 +0000 (10:59 +0100)
commitfbfcd0199170984bd3c2812e49ed0fe7b226959a
treea17482251a965cb047cda3d91bbc4810aeb3a48b
parentbd5c0ba2cd78a4c116726ead84f8f37dc92d043e
locking/xchg/alpha: Remove superfluous memory barriers from the _local() variants

The following two commits:

  79d442461df74 ("locking/xchg/alpha: Clean up barrier usage by using smp_mb() in place of __ASM__MB")
  472e8c55cf662 ("locking/xchg/alpha: Fix xchg() and cmpxchg() memory ordering bugs")

... ended up adding unnecessary barriers to the _local() variants on Alpha,
which the previous code took care to avoid.

Fix them by adding the smp_mb() into the cmpxchg() macro rather than into the
____cmpxchg() variants.

Reported-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-alpha@vger.kernel.org
Fixes: 472e8c55cf662 ("locking/xchg/alpha: Fix xchg() and cmpxchg() memory ordering bugs")
Fixes: 79d442461df74 ("locking/xchg/alpha: Clean up barrier usage by using smp_mb() in place of __ASM__MB")
Link: http://lkml.kernel.org/r/1519704058-13430-1-git-send-email-parri.andrea@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/alpha/include/asm/cmpxchg.h
arch/alpha/include/asm/xchg.h