public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Kyle McMartin <kyle@infradead.org>
Cc: Chuck Ebbert <cebbert@redhat.com>,
	linux-kernel@vger.kernel.org,
	Chris Mason <chris.mason@oracle.com>, Ingo Molnar <mingo@elte.hu>
Subject: Re: Build failure with latest -git: btrfs on ppc64
Date: Mon, 09 Feb 2009 16:39:08 -0500	[thread overview]
Message-ID: <4990A27C.2090407@suse.com> (raw)
In-Reply-To: <20090207232458.GB23407@bombadil.infradead.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kyle McMartin wrote:
> On Sat, Feb 07, 2009 at 03:50:39PM -0500, Chuck Ebbert wrote:
>> fs/btrfs/locking.c: In function 'btrfs_path_lock_waiting':
>> fs/btrfs/locking.c:254: error: implicit declaration of function '__raw_spin_is_contended'
>>
>> Looks like spin_is_contended() is only available on mips and x86??
>>
> 
> Looks to be if there are other folks in line for the ticket lock.
> 
> Arguably this should probably be something silly in spinlock.h like,
> 
> #ifndef __raw_spin_is_contended
> # define spin_is_contended (0)
> #else
> # define spin_is_contended(x) __raw_spin_is_contended((x))
> #endif
> 
> or something since in theory anybody has a chance of acquiring it next
> (well, lies because caches bias, but there's no waiters at least.)
> 
> Either that, or we just define it to be spin_is_locked if the assumption
> is that the lock will continue to be locked...

I fixed it in my tree using the following patch.

From: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH] spin_is_contended Kconfig fixes

 include/linux/spinlock.h contains the following chunk:
 #ifdef CONFIG_GENERIC_LOCKBREAK
 #define spin_is_contended(lock) ((lock)->break_lock)
 #else
 #define spin_is_contended(lock) __raw_spin_is_contended(&(lock)->raw_lock)
 #endif

 __raw_spin_is_contended() is only implemented on mips and x86.

 Prior to a recent commit against btrfs, spin_needbreak was the only
 user of spin_is_contended, and it returns 0 when !CONFIG_PREEMPT. The
 architecture Kconfigs reflect that, depending on PREEMPT to enable
 GENERIC_LOCKBREAK. With the btrfs changes, this is causing build
 failures on anything !x86 (and mips, but I don't build on mips).

 Now that there is another user of spin_is_contended, the PREEMPT
 dependency is obsolete. This removes the dependency.

 This patch also adds GENERIC_LOCKBREAK entries to architectures that
 didn't have it and offer SMP support.

 The removal of the SPARC64 dependency isn't an oversight - SMP is
 supported for 32-bit sparc, so it would run into the same problem.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
- ---
 arch/alpha/Kconfig    |    5 +++++
 arch/arm/Kconfig      |    2 +-
 arch/blackfin/Kconfig |    5 +++++
 arch/ia64/Kconfig     |    2 +-
 arch/m32r/Kconfig     |    2 +-
 arch/parisc/Kconfig   |    2 +-
 arch/powerpc/Kconfig  |    2 +-
 arch/s390/Kconfig     |    2 +-
 arch/sh/Kconfig       |    7 ++++++-
 arch/sparc/Kconfig    |    2 +-
 10 files changed, 23 insertions(+), 8 deletions(-)

- --- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -25,6 +25,11 @@ config MMU
 config RWSEM_GENERIC_SPINLOCK
 	bool
 
+config GENERIC_LOCKBREAK
+        bool
+        default y
+        depends on SMP
+
 config RWSEM_XCHGADD_ALGORITHM
 	bool
 	default y
- --- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -115,7 +115,7 @@ config GENERIC_IRQ_PROBE
 config GENERIC_LOCKBREAK
 	bool
 	default y
- -	depends on SMP && PREEMPT
+	depends on SMP
 
 config RWSEM_GENERIC_SPINLOCK
 	bool
- --- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -21,6 +21,11 @@ config RWSEM_XCHGADD_ALGORITHM
 	bool
 	default n
 
+config GENERIC_LOCKBREAK
+        bool
+        default y
+        depends on SMP
+
 config BLACKFIN
 	bool
 	default y
- --- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -58,7 +58,7 @@ config IOMMU_HELPER
 config GENERIC_LOCKBREAK
 	bool
 	default y
- -	depends on SMP && PREEMPT
+	depends on SMP
 
 config RWSEM_XCHGADD_ALGORITHM
 	bool
- --- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -243,7 +243,7 @@ config IRAM_SIZE
 config GENERIC_LOCKBREAK
 	bool
 	default y
- -	depends on SMP && PREEMPT
+	depends on SMP
 
 config RWSEM_GENERIC_SPINLOCK
 	bool
- --- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -27,7 +27,7 @@ config STACK_GROWSUP
 config GENERIC_LOCKBREAK
 	bool
 	default y
- -	depends on SMP && PREEMPT
+	depends on SMP
 
 config RWSEM_GENERIC_SPINLOCK
 	def_bool y
- --- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -75,7 +75,7 @@ config RWSEM_XCHGADD_ALGORITHM
 config GENERIC_LOCKBREAK
 	bool
 	default y
- -	depends on SMP && PREEMPT
+	depends on SMP
 
 config ARCH_HAS_ILOG2_U32
 	bool
- --- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -63,7 +63,7 @@ config NO_DMA
 config GENERIC_LOCKBREAK
 	bool
 	default y
- -	depends on SMP && PREEMPT
+	depends on SMP
 
 config PGSTE
 	bool
- --- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -43,6 +43,11 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
 	bool
 
+config GENERIC_LOCKBREAK
+        bool
+        default y
+        depends on SMP
+
 config GENERIC_BUG
 	def_bool y
 	depends on BUG && SUPERH32
@@ -82,7 +87,7 @@ config GENERIC_CLOCKEVENTS_BROADCAST
 
 config GENERIC_LOCKBREAK
 	def_bool y
- -	depends on SMP && PREEMPT
+	depends on SMP
 
 config SYS_SUPPORTS_PM
 	bool
- --- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -298,7 +298,7 @@ config US3_MC
 config GENERIC_LOCKBREAK
 	bool
 	default y
- -	depends on SPARC64 && SMP && PREEMPT
+	depends on SMP
 
 choice
 	prompt "SPARC64 Huge TLB Page Size"


- -- 
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkmQonwACgkQLPWxlyuTD7JPyQCghVJ0vgGlCxAbKZQMPaJxrIYZ
ePYAoIbujOBBnc0wqgn2bG+5KB11g8HL
=7r7Q
-----END PGP SIGNATURE-----

  parent reply	other threads:[~2009-02-09 21:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07 20:50 Build failure with latest -git: btrfs on ppc64 Chuck Ebbert
2009-02-07 23:24 ` Kyle McMartin
2009-02-09 14:57   ` Chris Mason
2009-02-09 15:57     ` Kyle McMartin
2009-02-09 16:05       ` Chris Mason
2009-02-09 21:39   ` Jeff Mahoney [this message]
2009-02-09 21:36 ` Chris Mason

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=4990A27C.2090407@suse.com \
    --to=jeffm@suse.com \
    --cc=cebbert@redhat.com \
    --cc=chris.mason@oracle.com \
    --cc=kyle@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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