]> git.baikalelectronics.ru Git - kernel.git/commit
u64_stats: provide u64_stats_t type
authorEric Dumazet <edumazet@google.com>
Fri, 8 Nov 2019 00:27:20 +0000 (16:27 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Nov 2019 04:03:08 +0000 (20:03 -0800)
commit6e4d7df7bad93b38cdd94ef5132ec382ae70635f
tree83ede594937ec2ce27335a73fb3d6cea4ef95909
parent12b7d16ef9ab54e3ccc34dc6881f656230012d9c
u64_stats: provide u64_stats_t type

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: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/u64_stats_sync.h