netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neal Cardwell <ncardwell@google.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 Willem de Bruijn <willemb@google.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	netdev@vger.kernel.org,  eric.dumazet@gmail.com
Subject: Re: [PATCH net] tcp: fix tcp_tso_should_defer() vs large RTT
Date: Sat, 11 Oct 2025 13:58:20 -0400	[thread overview]
Message-ID: <CADVnQyk7M2Z0fz3ub_qpVyW16mpEbRWjRudpRzzTvOMA3j9fLw@mail.gmail.com> (raw)
In-Reply-To: <20251011115742.1245771-1-edumazet@google.com>

On Sat, Oct 11, 2025 at 7:57 AM Eric Dumazet <edumazet@google.com> wrote:
>
> Neal reported that using neper tcp_stream with TCP_TX_DELAY
> set to 50ms would often lead to flows stuck in a small cwnd mode,
> regardless of the congestion control.
>
> While tcp_stream sets TCP_TX_DELAY too late after the connect(),
> it highlighted two kernel bugs.
>
> The following heuristic in tcp_tso_should_defer() seems wrong
> for large RTT:
>
> delta = tp->tcp_clock_cache - head->tstamp;
> /* If next ACK is likely to come too late (half srtt), do not defer */
> if ((s64)(delta - (u64)NSEC_PER_USEC * (tp->srtt_us >> 4)) < 0)
>       goto send_now;
>
> If next ACK is expected to come in more than 1 ms, we should
> not defer because we prefer a smooth ACK clocking.
>
> While blamed commit was a step in the good direction, it was not
> generic enough.
>
> Another patch fixing TCP_TX_DELAY for established flows
> will be proposed when net-next reopens.
>
> Fixes: 50c8339e9299 ("tcp: tso: restore IW10 after TSO autosizing")
> Reported-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---

Thanks, Eric! Great catch! The patch looks great to me, and I tested
that it fixes the issue I was seeing with neper tcp_stream with
TCP_TX_DELAY.

Reviewed-by: Neal Cardwell <ncardwell@google.com>
Tested-by: Neal Cardwell <ncardwell@google.com>

neal

      reply	other threads:[~2025-10-11 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-11 11:57 [PATCH net] tcp: fix tcp_tso_should_defer() vs large RTT Eric Dumazet
2025-10-11 17:58 ` Neal Cardwell [this message]

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=CADVnQyk7M2Z0fz3ub_qpVyW16mpEbRWjRudpRzzTvOMA3j9fLw@mail.gmail.com \
    --to=ncardwell@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).