diff options
author | Eric Dumazet <edumazet@google.com> | 2025-05-13 19:39:12 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-05-15 11:30:08 -0700 |
commit | ea33537d82921e71f852ea2ed985acc562125efe (patch) | |
tree | b7bd20c601e5b232f8a9f154ffb5efa86342c89d /include/linux/tcp.h | |
parent | 63ad7dfedfaee60d9ab40f9f2ec4fb488fa9b1ec (diff) |
tcp: add receive queue awareness in tcp_rcv_space_adjust()
If the application can not drain fast enough a TCP socket queue,
tcp_rcv_space_adjust() can overestimate tp->rcvq_space.space.
Then sk->sk_rcvbuf can grow and hit tcp_rmem[2] for no good reason.
Fix this by taking into acount the number of available bytes.
Keeping sk->sk_rcvbuf at the right size allows better cache efficiency.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Wei Wang <weiwan@google.com>
Link: https://patch.msgid.link/20250513193919.1089692-5-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/tcp.h')
-rw-r--r-- | include/linux/tcp.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index a8af71623ba7..29f59d50dc73 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -340,7 +340,7 @@ struct tcp_sock { } rcv_rtt_est; /* Receiver queue space */ struct { - u32 space; + int space; u32 seq; u64 time; } rcvq_space; |