UPSTREAM: tcp: add receive queue awareness in tcp_rcv_space_adjust()
[ Upstream commit ea33537d ] 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. Change-Id: Iafe34f98bbe0deb9f34be9b55caece76ae02e0f7 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> Signed-off-by:
Sasha Levin <sashal@kernel.org> (cherry picked from commit 84c156a3) Bug: 437846539 Signed-off-by:
Greg Kroah-Hartman <gregkh@google.com>
Loading