Files
kernel_arpi/include/linux
Eric Dumazet 8a3b023710 net: add atomic_long_t to net_device_stats fields
[ Upstream commit 6c1c5097781f563b70a81683ea6fdac21637573b ]

Long standing KCSAN issues are caused by data-race around
some dev->stats changes.

Most performance critical paths already use per-cpu
variables, or per-queue ones.

It is reasonable (and more correct) to use atomic operations
for the slow paths.

This patch adds an union for each field of net_device_stats,
so that we can convert paths that are not yet protected
by a spinlock or a mutex.

netdev_stats_to_stats64() no longer has an #if BITS_PER_LONG==64

Note that the memcpy() we were using on 64bit arches
had no provision to avoid load-tearing,
while atomic_long_read() is providing the needed protection
at no cost.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:14:42 +01:00
..
2022-08-17 14:23:11 +02:00
2022-10-26 12:35:12 +02:00
2022-08-31 17:16:34 +02:00
2022-10-26 12:35:26 +02:00
2022-08-17 14:24:08 +02:00
2022-11-03 23:59:15 +09:00
2022-07-29 17:25:32 +02:00
2022-09-15 11:30:05 +02:00