• Rusty Russell's avatar
    [PATCH] introduce "local_t" - cpu-local atomic variables · f9feecc3
    Rusty Russell authored
    Introduces local_t, a type which is like atomic_t, but the
    operations are only atomic from a single CPU's point of view
    (ie. atomic against interrupts and softirqs). Some architectures
    (eg. i386) can implement these very efficiently.
    
    There are special operations for the case of a local operation on a
    per-cpu variable (which is common), which some architectures can
    implement efficiently (eg. IA64 keeps all per-cpu variables mapped
    at the same address, so no address arithmetic is needed).
    
    The generic implementation given here simply uses atomics on 32-bit
    archs, three variables on others.  x86 is already implemented specially.
    f9feecc3
local.h 1.77 KB