net: annotate lockless accesses to sk->sk_pacing_shift
authorEric Dumazet <edumazet@google.com>
Tue, 17 Dec 2019 02:51:03 +0000 (18:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2020 09:20:07 +0000 (10:20 +0100)
commit8f8e806c51925abae56007ad2560a3356a6de52e
tree3a6125b864f98c918c47e4a86964aafbd2669a62
parent2c446b34afb071add598c3a8acff53b13c9e5df9
net: annotate lockless accesses to sk->sk_pacing_shift

[ Upstream commit 7c68fa2bddda6d942bd387c9ba5b4300737fd991 ]

sk->sk_pacing_shift can be read and written without lock
synchronization. This patch adds annotations to
document this fact and avoid future syzbot complains.

This might also avoid unexpected false sharing
in sk_pacing_shift_update(), as the compiler
could remove the conditional check and always
write over sk->sk_pacing_shift :

if (sk->sk_pacing_shift != val)
sk->sk_pacing_shift = val;

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>
include/net/sock.h
net/core/sock.c
net/ipv4/tcp_bbr.c
net/ipv4/tcp_output.c