linux/include
Jake Moilanen d637413f3f [PATCH] ppc64: reverse prediction on spinlock busy loop code
On our raw spinlocks, we currently have an attempt at the lock, and if we do
not get it we enter a spin loop.  This spinloop will likely continue for
awhile, and we pridict likely.

Shouldn't we predict that we will get out of the loop so our next instructions
are already prefetched.  Even when we miss because the lock is still held, it
won't matter since we are waiting anyways.

I did a couple quick benchmarks, but the results are inconclusive.

	16-way 690 running specjbb with original code
	# ./specjbb 3000 16 1 1 19 30 120
	    ...
	Valid run, Score is 59282

	16-way 690 running specjbb with unlikely code
	# ./specjbb 3000 16 1 1 19 30 120
	    ...
	Valid run, Score is 59541

I saw a smaller increase on a JS20 (~1.6%)

	JS20 specjbb w/ original code
	# ./specjbb 400 2 1 1 19 30 120
	   ...
	Valid run, Score is 20460

	JS20 specjbb w/ unlikely code
	# ./specjbb 400 2 1 1 19 30 120
	   ...
	Valid run, Score is 20803

Anton said:

Mispredicting the spinlock busy loop also means we slow down the rate at which
we do the loads which can be good for heavily contended locks.

Note: There are some gcc issues with our default build and branch prediction,
but a CONFIG_POWER4_ONLY build should emit them correctly.  I'm working with
Alan Modra on it now.

Signed-off-by: Jake Moilanen <moilanen@austin.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-01 08:58:47 -07:00
..
acpi Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
asm-alpha [PATCH] alpha: key management syscalls 2005-04-21 11:28:26 -07:00
asm-arm [PATCH] ARM: IntegratorCP: Fix CLCD MUX selection values 2005-04-30 23:32:38 +01:00
asm-arm26 [PATCH] freepgt: arm26 FIRST_USER_ADDRESS PAGE_SIZE 2005-04-19 13:29:22 -07:00
asm-cris [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-frv [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-generic [PATCH] __get_unaligned() turned into macro 2005-04-24 12:28:35 -07:00
asm-h8300 [PATCH] h8300 header update 2005-04-16 15:25:21 -07:00
asm-i386 [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-ia64 [IA64] re-enable preempt before page allocation for pgtable quicklist 2005-04-26 09:04:31 -07:00
asm-m32r [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-m68k [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-m68knommu Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
asm-mips [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-parisc [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-ppc [PATCH] ppc32: refactor FPU exception handling 2005-05-01 08:58:40 -07:00
asm-ppc64 [PATCH] ppc64: reverse prediction on spinlock busy loop code 2005-05-01 08:58:47 -07:00
asm-s390 [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-sh [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-sh64 [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-sparc [SPARC]: Fix mxcc warning 2005-04-24 20:46:00 -07:00
asm-sparc64 [SPARC64]: Fix SMP build. 2005-04-24 21:04:02 -07:00
asm-um [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
asm-v850 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
asm-x86_64 [PATCH] freepgt: arch FIRST_USER_ADDRESS 0 2005-04-19 13:29:23 -07:00
linux [PATCH] macintosh/adbhid.c: adb buttons support for aluminium PowerBook G4 2005-05-01 08:58:41 -07:00
math-emu Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
media Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mtd Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
net [PKT_SCHED]: Fix range in psched_tod_diff() to 0..bound 2005-04-28 12:14:37 -07:00
pcmcia Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
rxrpc Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
scsi merge by hand (scsi_device.h) 2005-04-18 13:45:00 -05:00
sound Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
video Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00