lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4990A27C.2090407@suse.com>
Date:	Mon, 09 Feb 2009 16:39:08 -0500
From:	Jeff Mahoney <jeffm@...e.com>
To:	Kyle McMartin <kyle@...radead.org>
Cc:	Chuck Ebbert <cebbert@...hat.com>, linux-kernel@...r.kernel.org,
	Chris Mason <chris.mason@...cle.com>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: Build failure with latest -git: btrfs on ppc64

-----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@...e.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@...e.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-----
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ