On Fri, 2010-10-15 at 13:07 +0200, Gerald Schaefer wrote: > From: Gerald Schaefer > > The spinning mutex implementation uses cpu_relax() in busy loops as a > compiler barrier. Depending on the architecture, cpu_relax() may do more > than needed in this specific mutex spin loops. On System z we also give > up the time slice of the virtual cpu in cpu_relax(), which prevents > effective spinning on the mutex. > > This patch replaces cpu_relax() in the spinning mutex code with > arch_mutex_cpu_relax(), which can be defined by each architecture in > include/asm/mutex.h. The default is still cpu_relax(), so this should > not affect other architectures than System z for now. Ingo's randconfig build found the following, .config attached. including "asm/mutex.h" isn't advised. CC kernel/mutex.o In file included from /usr/src/linux-2.6/kernel/mutex.c:33: /usr/src/linux-2.6/include/asm-generic/mutex-null.h:13:1: warning: "__mutex_fastpath_lock" redefined In file included from /usr/src/linux-2.6/arch/x86/include/asm/mutex.h:4, from /usr/src/linux-2.6/include/linux/mutex.h:19, from /usr/src/linux-2.6/kernel/mutex.c:20: /usr/src/linux-2.6/arch/x86/include/asm/mutex_64.h:19:1: warning: this is the location of the previous definition In file included from /usr/src/linux-2.6/kernel/mutex.c:33: /usr/src/linux-2.6/include/asm-generic/mutex-null.h:15:1: warning: "__mutex_fastpath_unlock" redefined In file included from /usr/src/linux-2.6/arch/x86/include/asm/mutex.h:4, from /usr/src/linux-2.6/include/linux/mutex.h:19, from /usr/src/linux-2.6/kernel/mutex.c:20: /usr/src/linux-2.6/arch/x86/include/asm/mutex_64.h:62:1: warning: this is the location of the previous definition In file included from /usr/src/linux-2.6/kernel/mutex.c:33: /usr/src/linux-2.6/include/asm-generic/mutex-null.h:13:1: warning: "__mutex_fastpath_lock" redefined In file included from /usr/src/linux-2.6/arch/x86/include/asm/mutex.h:4, from /usr/src/linux-2.6/include/linux/mutex.h:19, from /usr/src/linux-2.6/kernel/mutex.c:20: /usr/src/linux-2.6/arch/x86/include/asm/mutex_64.h:19:1: warning: this is the location of the previous definition In file included from /usr/src/linux-2.6/kernel/mutex.c:33: /usr/src/linux-2.6/include/asm-generic/mutex-null.h:15:1: warning: "__mutex_fastpath_unlock" redefined In file included from /usr/src/linux-2.6/arch/x86/include/asm/mutex.h:4, from /usr/src/linux-2.6/include/linux/mutex.h:19, from /usr/src/linux-2.6/kernel/mutex.c:20: /usr/src/linux-2.6/arch/x86/include/asm/mutex_64.h:62:1: warning: this is the location of the previous definition