https://github.com/torvalds/linux
Revision a8ddac7e53e89cb877965097d05adfeb1c91def3 authored by Nick Piggin on 21 October 2008, 08:59:15 UTC, committed by Linus Torvalds on 23 October 2008, 16:18:20 UTC
- atomic operations which both modify the variable and return something imply
  full smp memory barriers before and after the memory operations involved
  (failing atomic_cmpxchg, atomic_add_unless, etc don't imply a barrier because
  they don't modify the target). See Documentation/atomic_ops.txt.
  So remove extra barriers and branches.

- All architectures support atomic_cmpxchg. This has no relation to
  __HAVE_ARCH_CMPXCHG. We can just take the atomic_cmpxchg path unconditionally

This reduces a simple single threaded fastpath lock+unlock test from 590 cycles
to 203 cycles on a ppc970 system.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5a439c5
History
Tip revision: a8ddac7e53e89cb877965097d05adfeb1c91def3 authored by Nick Piggin on 21 October 2008, 08:59:15 UTC
mutex: speed up generic mutex implementations
Tip revision: a8ddac7
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
usr
virt
.gitignore -rw-r--r-- 867 bytes
.mailmap -rw-r--r-- 3.7 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 91.0 KB
Kbuild -rw-r--r-- 2.4 KB
MAINTAINERS -rw-r--r-- 101.7 KB
Makefile -rw-r--r-- 55.4 KB
README -rw-r--r-- 16.5 KB
REPORTING-BUGS -rw-r--r-- 3.1 KB

README

back to top