linux-kernel-test/arch/powerpc/include/asm
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
..
iseries
8xx_immap.h
8253pit.h
abs_addr.h
agp.h
asm-compat.h
asm-offsets.h kbuild: move asm-offsets.h to include/generated 2009-12-12 13:08:14 +01:00
async_tx.h ppc440spe-adma: adds updated ppc440spe adma driver 2009-12-11 21:24:44 -07:00
atomic.h
auxvec.h
backlight.h
bitops.h
bitsperlong.h
bootx.h
btext.h
bug.h powerpc: Convert BUG() to use unreachable() 2009-12-18 14:54:27 +11:00
bugs.h
byteorder.h
cache.h
cacheflush.h
cell-pmu.h
cell-regs.h
checksum.h
clk_interface.h
code-patching.h
compat.h
cpm1.h
cpm2.h
cpm.h
cputable.h
cputhreads.h
cputime.h powerpc: Replace per_cpu(, smp_processor_id()) with __get_cpu_var() 2010-02-03 17:39:48 +11:00
current.h
dbdma.h
dbell.h
dcr-generic.h
dcr-mmio.h
dcr-native.h
dcr-regs.h ppc440spe-adma: adds updated ppc440spe adma driver 2009-12-11 21:24:44 -07:00
dcr.h
delay.h
device.h
disassemble.h
div64.h
dma-mapping.h dma-mapping: fix off-by-one error in dma_capable() 2009-12-16 07:20:12 -08:00
dma.h
edac.h
eeh_event.h
eeh.h
elf.h powerpc: TIF_ABI_PENDING bit removal 2010-02-01 14:00:30 +11:00
emergency-restart.h
emulated_ops.h
errno.h
exception-64e.h
exception-64s.h
fb.h
fcntl.h
feature-fixups.h
firmware.h
fixmap.h powerpc: reserve fixmap entries for early debug 2009-12-12 22:24:30 -07:00
floppy.h
fs_pd.h
fsl_gtm.h
fsl_lbc.h
fsldma.h
ftrace.h
futex.h
gpio.h powerpc/gpio: support gpio_to_irq() 2009-12-10 20:08:15 -06:00
grackle.h
hardirq.h powerpc: Convert global "BAD" interrupt to per cpu spurious 2010-02-17 14:02:49 +11:00
heathrow.h
highmem.h
hugetlb.h
hvcall.h Merge commit 'origin/master' into next 2009-12-09 17:14:38 +11:00
hvconsole.h
hvcserver.h
hw_irq.h
hydra.h
i8259.h
ibmebus.h
ide.h
immap_86xx.h
immap_cpm2.h
immap_qe.h
io-defs.h
io.h
ioctl.h
ioctls.h
iommu.h
ipcbuf.h
ipic.h
irq_regs.h
irq.h powerpc: Make "intspec" pointers in irq_host->xlate() const 2009-12-09 17:10:37 +11:00
irqflags.h
Kbuild
kdebug.h
kdump.h
kexec.h
keylargo.h
kgdb.h
kmap_types.h
kprobes.h
kvm_44x.h
kvm_asm.h
kvm_book3s_64_asm.h
kvm_book3s.h
kvm_e500.h
kvm_host.h
kvm_para.h
kvm_ppc.h
kvm.h
libata-portmap.h
linkage.h
lmb.h
local.h
lppaca.h
lv1call.h
machdep.h sysfs/cpu: Add probe/release files 2009-12-09 17:09:33 +11:00
macio.h
mc146818rtc.h
mediabay.h
mman.h
mmu_context.h
mmu-8xx.h
mmu-40x.h
mmu-44x.h
mmu-book3e.h
mmu-hash32.h
mmu-hash64.h
mmu.h
mmzone.h
module.h module: handle ppc64 relocating kcrctabs when CONFIG_RELOCATABLE=y 2009-12-15 16:28:34 +10:30
mpc5xxx.h
mpc6xx.h
mpc8xx.h
mpc52xx_psc.h
mpc52xx.h
mpc8260.h
mpic.h
msgbuf.h
msi_bitmap.h
mutex.h
nvram.h
of_device.h
of_platform.h
ohare.h
oprofile_impl.h
paca.h
page_32.h
page_64.h
page.h
param.h powerpc: Simplify param.h by including <asm-generic/param.h> 2010-02-03 17:39:48 +11:00
parport.h
pasemi_dma.h
pci-bridge.h
pci.h
percpu.h
perf_event.h
pgalloc-32.h
pgalloc-64.h
pgalloc.h
pgtable-ppc32.h
pgtable-ppc64-4k.h
pgtable-ppc64-64k.h
pgtable-ppc64.h
pgtable.h
phyp_dump.h
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h
pmc.h
pmi.h
poll.h
posix_types.h
ppc4xx.h
ppc_asm.h
ppc-opcode.h powerpc: Use lwarx hint in spinlocks 2010-02-17 14:03:14 +11:00
ppc-pci.h powerpc/eeh: Fix a bug when pci structure is null 2010-02-17 14:02:47 +11:00
processor.h
prom.h
ps3.h
ps3av.h
ps3fb.h
ps3gpu.h
ps3stor.h
pSeries_reconfig.h
pte-8xx.h powerpc/8xx: Restore _PAGE_WRITETHRU 2009-12-09 17:10:37 +11:00
pte-40x.h
pte-44x.h
pte-book3e.h
pte-common.h
pte-fsl-booke.h
pte-hash32.h
pte-hash64-4k.h
pte-hash64-64k.h
pte-hash64.h
ptrace.h ptrace: powerpc: implement user_single_step_siginfo() 2009-12-16 07:20:08 -08:00
qe_ic.h
qe.h
reg_8xx.h
reg_booke.h
reg_fsl_emb.h
reg.h
resource.h
rheap.h
rio.h
rtas.h locking: Convert raw_spinlock to arch_spinlock 2009-12-14 23:55:32 +01:00
rtc.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
sembuf.h
serial.h
setjmp.h
setup.h
sfp-machine.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h
smu.h
socket.h
sockios.h
sparsemem.h
spinlock_types.h locking: Convert raw_rwlock to arch_rwlock 2009-12-14 23:55:32 +01:00
spinlock.h powerpc: Use lwarx hint in spinlocks 2010-02-17 14:03:14 +11:00
spu_csa.h
spu_info.h
spu_priv1.h
spu.h
sstep.h
stat.h
statfs.h
string.h
suspend.h
swab.h
swiotlb.h
synch.h
syscall.h
syscalls.h
systbl.h
system.h
tce.h
termbits.h
termios.h
thread_info.h powerpc: TIF_ABI_PENDING bit removal 2010-02-01 14:00:30 +11:00
time.h
timex.h
tlb.h
tlbflush.h
topology.h powerpc: Reformat SD_NODE_INIT to match x86 2010-02-09 13:56:07 +11:00
trace.h
tsi108_irq.h
tsi108_pci.h
tsi108.h
types.h
uaccess.h
ucc_fast.h
ucc_slow.h
ucc.h
ucontext.h
udbg.h powerpc: gamecube/wii: early debugging using usbgecko 2009-12-12 22:24:31 -07:00
uic.h
unaligned.h
uninorth.h
unistd.h
user.h
vdso_datapage.h
vdso.h
vga.h
vio.h
xilinx_intc.h
xilinx_pci.h
xmon.h
xor.h