• Eric Dumazet's avatar
    u64_stats: provide u64_stats_t type · 316580b6
    Eric Dumazet authored
    On 64bit arches, struct u64_stats_sync is empty and provides
    no help against load/store tearing.
    
    Using READ_ONCE()/WRITE_ONCE() would be needed.
    
    But the update side would be slightly more expensive.
    
    local64_t was defined so that we could use regular adds
    in a manner which is atomic wrt IRQs.
    
    However the u64_stats infra means we do not have to use
    local64_t on 32bit arches since the syncp provides the needed
    protection.
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    316580b6
u64_stats_sync.h 5.75 KB