]> www.infradead.org Git - users/dwmw2/linux.git/commit
Revert "tcp: avoid atomic operations on sk->sk_rmem_alloc"
authorEric Dumazet <edumazet@google.com>
Mon, 31 Mar 2025 07:59:46 +0000 (07:59 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 31 Mar 2025 23:53:54 +0000 (16:53 -0700)
commitf278b6d5bb465c7fd66f3d103812947e55b376ed
tree80f0f7103f809d9a485053e203a62e15e09b4c40
parentdd07df9ff3d148aee87fcbab99ff14f0727752f4
Revert "tcp: avoid atomic operations on sk->sk_rmem_alloc"

This reverts commit 0de2a5c4b824da2205658ebebb99a55c43cdf60f.

I forgot that a TCP socket could receive messages in its error queue.

sock_queue_err_skb() can be called without socket lock being held,
and changes sk->sk_rmem_alloc.

The fact that skbs in error queue are limited by sk->sk_rcvbuf
means that error messages can be dropped if socket receive
queues are full, which is an orthogonal issue.

In future kernels, we could use a separate sk->sk_error_mem_alloc
counter specifically for the error queue.

Fixes: 0de2a5c4b824 ("tcp: avoid atomic operations on sk->sk_rmem_alloc")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250331075946.31960-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tcp.h
net/ipv4/tcp.c
net/ipv4/tcp_fastopen.c
net/ipv4/tcp_input.c