alistair23-linux/arch/x86/lib
Eric Dumazet aacf682fd8 x86: atomic64: Improve atomic64_read()
Linus noticed that the 32-bit version of atomic64_read() was
being overly complex with re-reading the value and doing a
retry loop over that.

Instead we can just rely on cmpxchg8b returning either the new
value or returning the current value.

We can use any 'old' value, which will be faster as it can be
loaded via immediates. Using some value that is not equal to
the real value in memory the instruction gets faster.

This also has the advantage that the CPU could avoid dirtying
the cacheline.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
LKML-Reference: <alpine.LFD.2.01.0907021653030.3210@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-07-03 13:26:40 +02:00
..
atomic64_32.c x86: atomic64: Improve atomic64_read() 2009-07-03 13:26:40 +02:00
checksum_32.S
clear_page_64.S
copy_page_64.S
copy_user_64.S x86: wrong register was used in align macro 2008-07-30 10:10:39 -07:00
copy_user_nocache_64.S x86: wrong register was used in align macro 2008-07-30 10:10:39 -07:00
csum-copy_64.S
csum-partial_64.c
csum-wrappers_64.c
delay.c x86, delay: tsc based udelay should have rdtsc_barrier 2009-06-25 16:47:40 -07:00
getuser.S x86: use _types.h headers in asm where available 2009-02-13 11:35:01 -08:00
io_64.c
iomap_copy_64.S
Makefile x86: atomic64: Move the 32-bit atomic64_t implementation to a .c file 2009-07-03 13:26:39 +02:00
memcpy_32.c
memcpy_64.S x86: memcpy, clean up 2009-03-12 12:21:17 +01:00
memmove_64.c
memset_64.S
mmx_32.c
msr.c x86: MSR: add methods for writing of an MSR on several CPUs 2009-06-10 12:18:43 +02:00
putuser.S x86: merge putuser asm functions. 2008-07-09 09:14:13 +02:00
rwlock_64.S
semaphore_32.S
string_32.c x86: coding style fixes to arch/x86/lib/string_32.c 2008-08-15 16:53:25 +02:00
strstr_32.c x86: coding style fixes to arch/x86/lib/strstr_32.c 2008-08-15 16:53:24 +02:00
thunk_32.S
thunk_64.S
usercopy_32.c x86: use early clobbers in usercopy*.c 2009-01-21 09:43:17 +01:00
usercopy_64.c x86, 64-bit: Clean up user address masking 2009-06-20 15:40:00 -07:00