Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

locking/mcs: Allow architecture specific asm files to be used for contended case

This patch allows each architecture to add its specific assembly optimized
arch_mcs_spin_lock_contended and arch_mcs_spinlock_uncontended for
MCS lock and unlock functions.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Scott J Norton <scott.norton@hp.com>
Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Cc: AswinChandramouleeswaran <aswin@hp.com>
Cc: George Spelvin <linux@horizon.com>
Cc: Rik vanRiel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: MichelLespinasse <walken@google.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Alex Shi <alex.shi@linaro.org>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Figo.zhang" <figo1802@gmail.com>
Cc: "Paul E.McKenney" <paulmck@linux.vnet.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Waiman Long <waiman.long@hp.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew R Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1390347382.3138.67.camel@schen9-DESK
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Tim Chen and committed by
Ingo Molnar
ddf1d169 b119fa61

+44
+1
arch/alpha/include/asm/Kbuild
··· 3 3 generic-y += clkdev.h 4 4 generic-y += exec.h 5 5 generic-y += hash.h 6 + generic-y += mcs_spinlock.h 6 7 generic-y += preempt.h 7 8 generic-y += trace_clock.h
+1
arch/arc/include/asm/Kbuild
··· 22 22 generic-y += kvm_para.h 23 23 generic-y += local.h 24 24 generic-y += local64.h 25 + generic-y += mcs_spinlock.h 25 26 generic-y += mman.h 26 27 generic-y += msgbuf.h 27 28 generic-y += param.h
+1
arch/arm/include/asm/Kbuild
··· 14 14 generic-y += kdebug.h 15 15 generic-y += local.h 16 16 generic-y += local64.h 17 + generic-y += mcs_spinlock.h 17 18 generic-y += msgbuf.h 18 19 generic-y += param.h 19 20 generic-y += parport.h
+1
arch/arm64/include/asm/Kbuild
··· 23 23 generic-y += kvm_para.h 24 24 generic-y += local.h 25 25 generic-y += local64.h 26 + generic-y += mcs_spinlock.h 26 27 generic-y += mman.h 27 28 generic-y += msgbuf.h 28 29 generic-y += mutex.h
+1
arch/avr32/include/asm/Kbuild
··· 11 11 generic-y += irq_regs.h 12 12 generic-y += local.h 13 13 generic-y += local64.h 14 + generic-y += mcs_spinlock.h 14 15 generic-y += param.h 15 16 generic-y += percpu.h 16 17 generic-y += preempt.h
+1
arch/blackfin/include/asm/Kbuild
··· 20 20 generic-y += kvm_para.h 21 21 generic-y += local.h 22 22 generic-y += local64.h 23 + generic-y += mcs_spinlock.h 23 24 generic-y += mman.h 24 25 generic-y += msgbuf.h 25 26 generic-y += mutex.h
+1
arch/c6x/include/asm/Kbuild
··· 25 25 generic-y += kdebug.h 26 26 generic-y += kmap_types.h 27 27 generic-y += local.h 28 + generic-y += mcs_spinlock.h 28 29 generic-y += mman.h 29 30 generic-y += mmu.h 30 31 generic-y += mmu_context.h
+1
arch/cris/include/asm/Kbuild
··· 9 9 generic-y += hash.h 10 10 generic-y += kvm_para.h 11 11 generic-y += linkage.h 12 + generic-y += mcs_spinlock.h 12 13 generic-y += module.h 13 14 generic-y += preempt.h 14 15 generic-y += trace_clock.h
+1
arch/frv/include/asm/Kbuild
··· 2 2 generic-y += clkdev.h 3 3 generic-y += exec.h 4 4 generic-y += hash.h 5 + generic-y += mcs_spinlock.h 5 6 generic-y += preempt.h 6 7 generic-y += trace_clock.h
+1
arch/hexagon/include/asm/Kbuild
··· 27 27 generic-y += kmap_types.h 28 28 generic-y += local.h 29 29 generic-y += local64.h 30 + generic-y += mcs_spinlock.h 30 31 generic-y += mman.h 31 32 generic-y += msgbuf.h 32 33 generic-y += pci.h
+1
arch/ia64/include/asm/Kbuild
··· 3 3 generic-y += exec.h 4 4 generic-y += hash.h 5 5 generic-y += kvm_para.h 6 + generic-y += mcs_spinlock.h 6 7 generic-y += preempt.h 7 8 generic-y += trace_clock.h 8 9 generic-y += vtime.h
+1
arch/m32r/include/asm/Kbuild
··· 2 2 generic-y += clkdev.h 3 3 generic-y += exec.h 4 4 generic-y += hash.h 5 + generic-y += mcs_spinlock.h 5 6 generic-y += module.h 6 7 generic-y += preempt.h 7 8 generic-y += trace_clock.h
+1
arch/m68k/include/asm/Kbuild
··· 16 16 generic-y += kvm_para.h 17 17 generic-y += local.h 18 18 generic-y += local64.h 19 + generic-y += mcs_spinlock.h 19 20 generic-y += mman.h 20 21 generic-y += mutex.h 21 22 generic-y += percpu.h
+1
arch/metag/include/asm/Kbuild
··· 24 24 generic-y += kvm_para.h 25 25 generic-y += local.h 26 26 generic-y += local64.h 27 + generic-y += mcs_spinlock.h 27 28 generic-y += msgbuf.h 28 29 generic-y += mutex.h 29 30 generic-y += param.h
+1
arch/microblaze/include/asm/Kbuild
··· 3 3 generic-y += clkdev.h 4 4 generic-y += exec.h 5 5 generic-y += hash.h 6 + generic-y += mcs_spinlock.h 6 7 generic-y += preempt.h 7 8 generic-y += syscalls.h 8 9 generic-y += trace_clock.h
+1
arch/mips/include/asm/Kbuild
··· 4 4 generic-y += emergency-restart.h 5 5 generic-y += hash.h 6 6 generic-y += local64.h 7 + generic-y += mcs_spinlock.h 7 8 generic-y += mutex.h 8 9 generic-y += parport.h 9 10 generic-y += percpu.h
+1
arch/mn10300/include/asm/Kbuild
··· 3 3 generic-y += clkdev.h 4 4 generic-y += exec.h 5 5 generic-y += hash.h 6 + generic-y += mcs_spinlock.h 6 7 generic-y += preempt.h 7 8 generic-y += trace_clock.h
+1
arch/openrisc/include/asm/Kbuild
··· 35 35 generic-y += kmap_types.h 36 36 generic-y += kvm_para.h 37 37 generic-y += local.h 38 + generic-y += mcs_spinlock.h 38 39 generic-y += mman.h 39 40 generic-y += module.h 40 41 generic-y += msgbuf.h
+1
arch/parisc/include/asm/Kbuild
··· 14 14 generic-y += kvm_para.h 15 15 generic-y += local.h 16 16 generic-y += local64.h 17 + generic-y += mcs_spinlock.h 17 18 generic-y += mutex.h 18 19 generic-y += param.h 19 20 generic-y += percpu.h
+1
arch/powerpc/include/asm/Kbuild
··· 1 1 2 2 generic-y += clkdev.h 3 3 generic-y += hash.h 4 + generic-y += mcs_spinlock.h 4 5 generic-y += preempt.h 5 6 generic-y += rwsem.h 6 7 generic-y += trace_clock.h
+1
arch/s390/include/asm/Kbuild
··· 2 2 3 3 generic-y += clkdev.h 4 4 generic-y += hash.h 5 + generic-y += mcs_spinlock.h 5 6 generic-y += preempt.h 6 7 generic-y += trace_clock.h
+1
arch/score/include/asm/Kbuild
··· 5 5 generic-y += barrier.h 6 6 generic-y += clkdev.h 7 7 generic-y += hash.h 8 + generic-y += mcs_spinlock.h 8 9 generic-y += preempt.h 9 10 generic-y += trace_clock.h 10 11 generic-y += xor.h
+1
arch/sh/include/asm/Kbuild
··· 15 15 generic-y += kvm_para.h 16 16 generic-y += local.h 17 17 generic-y += local64.h 18 + generic-y += mcs_spinlock.h 18 19 generic-y += mman.h 19 20 generic-y += msgbuf.h 20 21 generic-y += param.h
+1
arch/sparc/include/asm/Kbuild
··· 11 11 generic-y += linkage.h 12 12 generic-y += local.h 13 13 generic-y += local64.h 14 + generic-y += mcs_spinlock.h 14 15 generic-y += module.h 15 16 generic-y += mutex.h 16 17 generic-y += preempt.h
+1
arch/tile/include/asm/Kbuild
··· 19 19 generic-y += irq_regs.h 20 20 generic-y += local.h 21 21 generic-y += local64.h 22 + generic-y += mcs_spinlock.h 22 23 generic-y += msgbuf.h 23 24 generic-y += mutex.h 24 25 generic-y += param.h
+1
arch/um/include/asm/Kbuild
··· 15 15 generic-y += io.h 16 16 generic-y += irq_regs.h 17 17 generic-y += kdebug.h 18 + generic-y += mcs_spinlock.h 18 19 generic-y += mutex.h 19 20 generic-y += param.h 20 21 generic-y += pci.h
+1
arch/unicore32/include/asm/Kbuild
··· 25 25 generic-y += kdebug.h 26 26 generic-y += kmap_types.h 27 27 generic-y += local.h 28 + generic-y += mcs_spinlock.h 28 29 generic-y += mman.h 29 30 generic-y += module.h 30 31 generic-y += msgbuf.h
+1
arch/x86/include/asm/Kbuild
··· 5 5 genhdr-y += unistd_x32.h 6 6 7 7 generic-y += clkdev.h 8 + generic-y += mcs_spinlock.h
+1
arch/xtensa/include/asm/Kbuild
··· 18 18 generic-y += linkage.h 19 19 generic-y += local.h 20 20 generic-y += local64.h 21 + generic-y += mcs_spinlock.h 21 22 generic-y += percpu.h 22 23 generic-y += preempt.h 23 24 generic-y += resource.h
+13
include/asm-generic/mcs_spinlock.h
··· 1 + #ifndef __ASM_MCS_SPINLOCK_H 2 + #define __ASM_MCS_SPINLOCK_H 3 + 4 + /* 5 + * Architectures can define their own: 6 + * 7 + * arch_mcs_spin_lock_contended(l) 8 + * arch_mcs_spin_unlock_contended(l) 9 + * 10 + * See kernel/locking/mcs_spinlock.c. 11 + */ 12 + 13 + #endif /* __ASM_MCS_SPINLOCK_H */
+2
include/linux/mcs_spinlock.h
··· 12 12 #ifndef __LINUX_MCS_SPINLOCK_H 13 13 #define __LINUX_MCS_SPINLOCK_H 14 14 15 + #include <asm/mcs_spinlock.h> 16 + 15 17 struct mcs_spinlock { 16 18 struct mcs_spinlock *next; 17 19 int locked; /* 1 if lock acquired */