Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95c354fe authored by Nick Piggin's avatar Nick Piggin Committed by Ingo Molnar
Browse files

spinlock: lockbreak cleanup



The break_lock data structure and code for spinlocks is quite nasty.
Not only does it double the size of a spinlock but it changes locking to
a potentially less optimal trylock.

Put all of that under CONFIG_GENERIC_LOCKBREAK, and introduce a
__raw_spin_is_contended that uses the lock data itself to determine whether
there are waiters on the lock, to be used if CONFIG_GENERIC_LOCKBREAK is
not set.

Rename need_lockbreak to spin_needbreak, make it use spin_is_contended to
decouple it from the spinlock implementation, and make it typesafe (rwlocks
do not have any need_lockbreak sites -- why do they even get bloated up
with that break_lock then?).

Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent a95d67f8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -91,6 +91,11 @@ config GENERIC_IRQ_PROBE
	bool
	default y

config GENERIC_LOCKBREAK
	bool
	default y
	depends on SMP && PREEMPT

config RWSEM_GENERIC_SPINLOCK
	bool
	default y
+5 −0
Original line number Diff line number Diff line
@@ -42,6 +42,11 @@ config MMU
config SWIOTLB
       bool

config GENERIC_LOCKBREAK
	bool
	default y
	depends on SMP && PREEMPT

config RWSEM_XCHGADD_ALGORITHM
	bool
	default y
+5 −0
Original line number Diff line number Diff line
@@ -235,6 +235,11 @@ config IRAM_SIZE
# Define implied options from the CPU selection here
#

config GENERIC_LOCKBREAK
	bool
	default y
	depends on SMP && PREEMPT

config RWSEM_GENERIC_SPINLOCK
	bool
	depends on M32R
+5 −0
Original line number Diff line number Diff line
@@ -694,6 +694,11 @@ source "arch/mips/vr41xx/Kconfig"

endmenu

config GENERIC_LOCKBREAK
	bool
	default y
	depends on SMP && PREEMPT

config RWSEM_GENERIC_SPINLOCK
	bool
	default y
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,11 @@ config MMU
config STACK_GROWSUP
	def_bool y

config GENERIC_LOCKBREAK
	bool
	default y
	depends on SMP && PREEMPT

config RWSEM_GENERIC_SPINLOCK
	def_bool y

Loading