From: Jakub Kicinski <kuba@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: netdev@vger.kernel.org
Subject: Re: TCP OOM drops with the stricter rcvbuf checking
Date: Wed, 25 Feb 2026 13:44:28 -0800 [thread overview]
Message-ID: <20260225134428.570bfbfd@kernel.org> (raw)
In-Reply-To: <20260225122355.585fd57b@kernel.org>
On Wed, 25 Feb 2026 12:23:55 -0800 Jakub Kicinski wrote:
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 326b58ff1118..9f7ed76a97aa 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -3383,7 +3383,8 @@ u32 __tcp_select_window(struct sock *sk)
> * Import case: prevent zero window announcement if
> * 1<<rcv_wscale > mss.
> */
> - window = ALIGN(window, (1 << tp->rx_opt.rcv_wscale));
> + if (window < (1 << tp->rx_opt.rcv_wscale))
> + window = ALIGN(window, (1 << tp->rx_opt.rcv_wscale));
> } else {
> window = tp->rcv_wnd;
> /* Get the largest window that is a nice multiple of mss.
Hm, reading thru __tcp_select_window() more carefully I guess there's
already an attempt to solve this:
if (free_space < (full_space >> 1)) {
...
/* free_space might become our new window, make sure we don't
* increase it due to wscale.
*/
free_space = round_down(free_space, 1 << tp->rx_opt.rcv_wscale);
the problem is that over loopback we can receive rather large skbs,
so we don't hit this round_down(). The drops I see have < 64k inq,
and the incoming skb is > 64k.
Perhaps this condition should check if free_space < gro_ipv*_max_size
as well (modulo gro_*_max_size vs tso_max_size on loopback)?
next prev parent reply other threads:[~2026-02-25 21:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 20:23 TCP OOM drops with the stricter rcvbuf checking Jakub Kicinski
2026-02-25 21:44 ` Jakub Kicinski [this message]
2026-02-26 1:58 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260225134428.570bfbfd@kernel.org \
--to=kuba@kernel.org \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox