tcp: annotate lockless access to tcp_memory_pressure
authorEric Dumazet <edumazet@google.com>
Wed, 9 Oct 2019 22:10:15 +0000 (15:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:46:50 +0000 (14:46 +0100)
commita8e920b22026c4717daee0e16ecee828aecfcb84
tree6f9020144f3067caed0757c3da07fab953786b18
parent681c8c92c4b78e80e0853f8e18861e93069d68e6
tcp: annotate lockless access to tcp_memory_pressure

[ Upstream commit 1f142c17d19a5618d5a633195a46f2c8be9bf232 ]

tcp_memory_pressure is read without holding any lock,
and its value could be changed on other cpus.

Use READ_ONCE() to annotate these lockless reads.

The write side is already using atomic ops.

Fixes: b8da51ebb1aa ("tcp: introduce tcp_under_memory_pressure()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/tcp.h
net/ipv4/tcp.c