• Nick Piggin's avatar
    [PATCH] atomic: add_unless cmpxchg optimise · 0b2fcfdb
    Nick Piggin authored
    Without branch hints, the very unlikely chance of the loop repeating due to
    cmpxchg failure is unrolled with gcc-4 that I have tested.
    
    Improve this for architectures with a native cas/cmpxchg.  llsc archs
    should try to implement this natively.
    Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
    Cc: Andi Kleen <ak@muc.de>
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Roman Zippel <zippel@linux-m68k.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    0b2fcfdb
atomic.h 3.35 KB