• Will Deacon's avatar
    ARM: locks: prefetch the destination word for write prior to strex · 9bb17be0
    Will Deacon authored
    The cost of changing a cacheline from shared to exclusive state can be
    significant, especially when this is triggered by an exclusive store,
    since it may result in having to retry the transaction.
    
    This patch prefixes our {spin,read,write}_[try]lock implementations with
    pldw instructions (on CPUs which support them) to try and grab the line
    in exclusive state from the start. arch_rwlock_t is changed to avoid
    using a volatile member, since this generates compiler warnings when
    falling back on the __builtin_prefetch intrinsic which expects a const
    void * argument.
    Acked-by: default avatarNicolas Pitre <nico@linaro.org>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    9bb17be0
spinlock.h 6.12 KB