linux/arch/powerpc
Anton Blanchard 4e14a4d17a powerpc: Use lwarx hint in spinlocks
Recent versions of the PowerPC architecture added a hint bit to the larx
instructions to differentiate between an atomic operation and a lock operation:

> 0 Other programs might attempt to modify the word in storage addressed by EA
> even if the subsequent Store Conditional succeeds.
>
> 1 Other programs will not attempt to modify the word in storage addressed by
> EA until the program that has acquired the lock performs a subsequent store
> releasing the lock.

To avoid a binutils dependency this patch create macros for the extended lwarx
format and uses it in the spinlock code. To test this change I used a simple
test case that acquires and releases a global pthread mutex:

	pthread_mutex_lock(&mutex);
	pthread_mutex_unlock(&mutex);

On a 32 core POWER6, running 32 test threads we spend almost all our time in
the futex spinlock code:

    94.37%     perf  [kernel]                     [k] ._raw_spin_lock
               |
               |--99.95%-- ._raw_spin_lock
               |          |
               |          |--63.29%-- .futex_wake
               |          |
               |          |--36.64%-- .futex_wait_setup

Which is a good test for this patch. The results (in lock/unlock operations per
second) are:

before: 1538203 ops/sec
after:  2189219 ops/sec

An improvement of 42%

A 32 core POWER7 improves even more:

before: 1279529 ops/sec
after:  2282076 ops/sec

An improvement of 78%

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-02-17 14:03:14 +11:00
..
boot zlib: Fix build of powerpc boot wrapper 2010-01-13 16:13:39 -08:00
configs powerpc: Reduce differences between pseries and ppc64 defconfigs 2010-02-09 13:56:06 +11:00
include/asm powerpc: Use lwarx hint in spinlocks 2010-02-17 14:03:14 +11:00
kernel powerpc: Convert global "BAD" interrupt to per cpu spurious 2010-02-17 14:02:49 +11:00
kvm KVM: powerpc: Show timing option only on embedded 2010-01-25 12:26:36 -02:00
lib locking: Convert raw_rwlock to arch_rwlock 2009-12-14 23:55:32 +01:00
math-emu powerpc/math-emu: Fix efp dependence 2009-03-11 06:00:08 -05:00
mm Merge commit 'origin/master' into next 2010-02-17 10:00:42 +11:00
oprofile tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
platforms powerpc: Remove whitespace in irq chip name fields 2010-02-17 14:02:48 +11:00
sysdev powerpc: Remove whitespace in irq chip name fields 2010-02-17 14:02:48 +11:00
xmon powerpc: Mark some variables in the page fault path __read_mostly 2010-02-03 17:39:48 +11:00
Kconfig powerpc: Increase NR_IRQS Kconfig maximum to 32768 2010-02-03 17:39:50 +11:00
Kconfig.debug Merge branch 'next' of git://git.secretlab.ca/git/linux-2.6 2009-12-16 13:26:53 -08:00
Makefile powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00
relocs_check.pl powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00