tcp: avoid atomic operations on sk->sk_rmem_alloc
authorEric Dumazet <edumazet@google.com>
Thu, 20 Mar 2025 12:16:04 +0000 (12:16 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Mar 2025 14:37:16 +0000 (07:37 -0700)
commit0de2a5c4b824da2205658ebebb99a55c43cdf60f
tree35c86479d8dd4f78f78c63164a17f70fc9e72b3a
parentc1dacb45778ca9749cb2a5dd61c2d196979ecfce
tcp: avoid atomic operations on sk->sk_rmem_alloc

TCP uses generic skb_set_owner_r() and sock_rfree()
for received packets, with socket lock being owned.

Switch to private versions, avoiding two atomic operations
per packet.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250320121604.3342831-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