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:Nick Piggin <npiggin@suse.de> Signed-off-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Thomas Gleixner <tglx@linutronix.de>
Showing
- arch/arm/Kconfig 5 additions, 0 deletionsarch/arm/Kconfig
- arch/ia64/Kconfig 5 additions, 0 deletionsarch/ia64/Kconfig
- arch/m32r/Kconfig 5 additions, 0 deletionsarch/m32r/Kconfig
- arch/mips/Kconfig 5 additions, 0 deletionsarch/mips/Kconfig
- arch/parisc/Kconfig 5 additions, 0 deletionsarch/parisc/Kconfig
- arch/powerpc/Kconfig 5 additions, 0 deletionsarch/powerpc/Kconfig
- arch/sparc64/Kconfig 5 additions, 0 deletionsarch/sparc64/Kconfig
- arch/x86/Kconfig 4 additions, 0 deletionsarch/x86/Kconfig
- fs/jbd/checkpoint.c 2 additions, 1 deletionfs/jbd/checkpoint.c
- fs/jbd/commit.c 1 addition, 1 deletionfs/jbd/commit.c
- fs/jbd2/checkpoint.c 2 additions, 1 deletionfs/jbd2/checkpoint.c
- fs/jbd2/commit.c 1 addition, 1 deletionfs/jbd2/commit.c
- include/linux/sched.h 7 additions, 14 deletionsinclude/linux/sched.h
- include/linux/spinlock.h 6 additions, 0 deletionsinclude/linux/spinlock.h
- include/linux/spinlock_types.h 2 additions, 2 deletionsinclude/linux/spinlock_types.h
- include/linux/spinlock_up.h 2 additions, 0 deletionsinclude/linux/spinlock_up.h
- kernel/sched.c 6 additions, 10 deletionskernel/sched.c
- kernel/spinlock.c 1 addition, 2 deletionskernel/spinlock.c
- mm/memory.c 3 additions, 5 deletionsmm/memory.c
Loading
Please register or sign in to comment