public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation•org>
To: linux-kernel@vger•kernel.org
Cc: Peter Zijlstra <peterz@infradead•org>,
	Will Deacon <will.deacon@arm•com>,
	James Bottomley <James.Bottomley@hansenpartnership•com>,
	Davidlohr Bueso <davidlohr@hp•com>,
	sparclinux@vger•kernel.org, Ingo Molnar <mingo@kernel•org>,
	Russell King <linux@arm•linux.org.uk>,
	"James E.J. Bottomley" <jejb@parisc-linux•org>,
	Linus Torvalds <torvalds@linux-foundation•org>,
	Catalin Marinas <catalin.marinas@arm•com>,
	Paul McKenney <paulmck@linux•vnet.ibm.com>,
	James Hogan <james.hogan@imgtec•com>,
	Chris Metcalf <cmetcalf@tilera•com>,
	Mikulas Patocka <mpatocka@redhat•com>,
	John David Anglin <dave.anglin@bell•net>,
	linux-arm-kernel@lists•infradead.org,
	Jason Low <jason.low2@hp•com>, Waiman Long <waiman.long@hp•com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
	stable@vger•kernel.org, Vineet Gupta <vgupta@synopsys•com>,
	linuxppc-dev@lists•ozlabs.org, David Miller <davem@davemloft•net>
Subject: [PATCH 3.10 54/56] locking/mutex: Disable optimistic spinning on some architectures
Date: Sat, 26 Jul 2014 12:02:47 -0700	[thread overview]
Message-ID: <20140726190201.843883600@linuxfoundation.org> (raw)
In-Reply-To: <20140726190200.061512159@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Peter Zijlstra <peterz@infradead•org>

commit 4badad352a6bb202ec68afa7a574c0bb961e5ebc upstream.

The optimistic spin code assumes regular stores and cmpxchg() play nice;
this is found to not be true for at least: parisc, sparc32, tile32,
metag-lock1, arc-!llsc and hexagon.

There is further wreckage, but this in particular seemed easy to
trigger, so blacklist this.

Opt in for known good archs.

Signed-off-by: Peter Zijlstra <peterz@infradead•org>
Reported-by: Mikulas Patocka <mpatocka@redhat•com>
Cc: David Miller <davem@davemloft•net>
Cc: Chris Metcalf <cmetcalf@tilera•com>
Cc: James Bottomley <James.Bottomley@hansenpartnership•com>
Cc: Vineet Gupta <vgupta@synopsys•com>
Cc: Jason Low <jason.low2@hp•com>
Cc: Waiman Long <waiman.long@hp•com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux•org>
Cc: Paul McKenney <paulmck@linux•vnet.ibm.com>
Cc: John David Anglin <dave.anglin@bell•net>
Cc: James Hogan <james.hogan@imgtec•com>
Cc: Linus Torvalds <torvalds@linux-foundation•org>
Cc: Davidlohr Bueso <davidlohr@hp•com>
Cc: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Cc: Catalin Marinas <catalin.marinas@arm•com>
Cc: Russell King <linux@arm•linux.org.uk>
Cc: Will Deacon <will.deacon@arm•com>
Cc: linux-arm-kernel@lists•infradead.org
Cc: linux-kernel@vger•kernel.org
Cc: linuxppc-dev@lists•ozlabs.org
Cc: sparclinux@vger•kernel.org
Link: http://lkml.kernel.org/r/20140606175316.GV13930@laptop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel•org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation•org>

---
 arch/arm/Kconfig     |    1 +
 arch/arm64/Kconfig   |    1 +
 arch/powerpc/Kconfig |    1 +
 arch/sparc/Kconfig   |    1 +
 arch/x86/Kconfig     |    1 +
 kernel/Kconfig.locks |    5 ++++-
 6 files changed, 9 insertions(+), 1 deletion(-)

--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -4,6 +4,7 @@ config ARM
 	select ARCH_BINFMT_ELF_RANDOMIZE_PIE
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 	select ARCH_HAVE_CUSTOM_GPIO_H
+	select ARCH_SUPPORTS_ATOMIC_RMW
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select BUILDTIME_EXTABLE_SORT if MMU
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1,6 +1,7 @@
 config ARM64
 	def_bool y
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+	select ARCH_SUPPORTS_ATOMIC_RMW
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
 	select ARCH_WANT_FRAME_POINTERS
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -138,6 +138,7 @@ config PPC
 	select ARCH_USE_BUILTIN_BSWAP
 	select OLD_SIGSUSPEND
 	select OLD_SIGACTION if PPC32
+	select ARCH_SUPPORTS_ATOMIC_RMW
 
 config EARLY_PRINTK
 	bool
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -77,6 +77,7 @@ config SPARC64
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select HAVE_C_RECORDMCOUNT
 	select NO_BOOTMEM
+	select ARCH_SUPPORTS_ATOMIC_RMW
 
 config ARCH_DEFCONFIG
 	string
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -121,6 +121,7 @@ config X86
 	select OLD_SIGACTION if X86_32
 	select COMPAT_OLD_SIGACTION if IA32_EMULATION
 	select RTC_LIB
+	select ARCH_SUPPORTS_ATOMIC_RMW
 
 config INSTRUCTION_DECODER
 	def_bool y
--- a/kernel/Kconfig.locks
+++ b/kernel/Kconfig.locks
@@ -220,6 +220,9 @@ config INLINE_WRITE_UNLOCK_IRQRESTORE
 
 endif
 
+config ARCH_SUPPORTS_ATOMIC_RMW
+	bool
+
 config MUTEX_SPIN_ON_OWNER
 	def_bool y
-	depends on SMP && !DEBUG_MUTEXES
+	depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW

           reply	other threads:[~2014-07-26 19:03 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20140726190200.061512159@linuxfoundation.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140726190201.843883600@linuxfoundation.org \
    --to=gregkh@linuxfoundation$(echo .)org \
    --cc=James.Bottomley@hansenpartnership$(echo .)com \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=cmetcalf@tilera$(echo .)com \
    --cc=dave.anglin@bell$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=davidlohr@hp$(echo .)com \
    --cc=james.hogan@imgtec$(echo .)com \
    --cc=jason.low2@hp$(echo .)com \
    --cc=jejb@parisc-linux$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux@arm$(echo .)linux.org.uk \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mingo@kernel$(echo .)org \
    --cc=mpatocka@redhat$(echo .)com \
    --cc=paulmck@linux$(echo .)vnet.ibm.com \
    --cc=peterz@infradead$(echo .)org \
    --cc=sparclinux@vger$(echo .)kernel.org \
    --cc=stable@vger$(echo .)kernel.org \
    --cc=torvalds@linux-foundation$(echo .)org \
    --cc=vgupta@synopsys$(echo .)com \
    --cc=waiman.long@hp$(echo .)com \
    --cc=will.deacon@arm$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox