linux/arch
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
..
alpha alpha: cpumask_of_node() should handle -1 as a node 2010-01-14 13:21:35 -05:00
arm OMAP: hsmmc: fix memory leak 2010-02-10 09:20:33 -08:00
avr32 avr32: clean up memory allocation in at32_add_device_mci 2009-12-28 12:33:00 +01:00
blackfin blackfin,kgdb: Do not put PC in gdb_regs into retx. 2010-01-07 11:58:37 -06:00
cris Merge branch 'for-33' of git://repo.or.cz/linux-kbuild 2009-12-17 07:23:42 -08:00
frv FDPIC: Respect PT_GNU_STACK exec protection markings when creating NOMMU stack 2010-01-06 18:16:02 -08:00
h8300 Merge branch 'for-33' of git://repo.or.cz/linux-kbuild 2009-12-17 07:23:42 -08:00
ia64 [IA64] preserve personality flag bits across exec 2010-02-12 08:17:58 -08:00
m32r elf: kill USE_ELF_CORE_DUMP 2009-12-16 07:20:12 -08:00
m68k m68knommu: fix definitions of __pa() and __va() 2010-01-12 20:51:45 -08:00
m68knommu m68knommu: fix invalid flags on coldfire pit clocksource 2010-01-16 12:15:38 -08:00
microblaze microblaze: Invalidate dcache before enabling it 2010-02-08 11:39:18 +01:00
mips MIPS: Don't probe reserved EntryHi bits. 2010-02-10 22:15:46 +01:00
mn10300 mn10300: update the ASB2303 defconfig 2010-01-11 09:34:10 -08:00
parisc parisc: fix tracing of signals 2010-02-12 08:51:58 -08:00
powerpc powerpc: Use lwarx hint in spinlocks 2010-02-17 14:03:14 +11:00
s390 [S390] Fix struct _lowcore layout. 2010-02-09 09:46:23 +01:00
score mm: make totalhigh_pages unsigned long 2010-01-11 09:34:03 -08:00
sh sh64: fix tracing of signals. 2010-02-15 14:17:45 +09:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2010-02-11 14:00:27 -08:00
um Unrot uml mconsole a bit 2010-01-14 09:05:26 -05:00
x86 x86: ELF_PLAT_INIT() shouldn't worry about TIF_IA32 2010-02-16 08:51:49 -08:00
xtensa Merge branch 'for-33' of git://repo.or.cz/linux-kbuild 2009-12-17 07:23:42 -08:00
.gitignore
Kconfig hw-breakpoints: Fix hardware breakpoints -> perf events dependency 2009-12-18 13:11:51 +01:00