Commit 57f4257e authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Linus Torvalds

lockref: use BLOATED_SPINLOCKS to avoid explicit config dependencies

Avoid the fragile Kconfig construct guestimating spinlock_t sizes; use a
friendly compile-time test to determine this.

[kirill.shutemov@linux.intel.com: drop CONFIG_CMPXCHG_LOCKREF]
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ea1e7ed3
...@@ -15,10 +15,15 @@ ...@@ -15,10 +15,15 @@
*/ */
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <generated/bounds.h>
#define USE_CMPXCHG_LOCKREF \
(IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \
IS_ENABLED(CONFIG_SMP) && !BLOATED_SPINLOCKS)
struct lockref { struct lockref {
union { union {
#ifdef CONFIG_CMPXCHG_LOCKREF #if USE_CMPXCHG_LOCKREF
aligned_u64 lock_count; aligned_u64 lock_count;
#endif #endif
struct { struct {
......
...@@ -51,13 +51,6 @@ config PERCPU_RWSEM ...@@ -51,13 +51,6 @@ config PERCPU_RWSEM
config ARCH_USE_CMPXCHG_LOCKREF config ARCH_USE_CMPXCHG_LOCKREF
bool bool
config CMPXCHG_LOCKREF
def_bool y if ARCH_USE_CMPXCHG_LOCKREF
depends on SMP
depends on !GENERIC_LOCKBREAK
depends on !DEBUG_SPINLOCK
depends on !DEBUG_LOCK_ALLOC
config CRC_CCITT config CRC_CCITT
tristate "CRC-CCITT functions" tristate "CRC-CCITT functions"
help help
......
#include <linux/export.h> #include <linux/export.h>
#include <linux/lockref.h> #include <linux/lockref.h>
#ifdef CONFIG_CMPXCHG_LOCKREF #if USE_CMPXCHG_LOCKREF
/* /*
* Allow weakly-ordered memory architectures to provide barrier-less * Allow weakly-ordered memory architectures to provide barrier-less
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment