* [PATCH net] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate
@ 2020-11-16 17:44 Ryan Sharpelletti
2020-11-16 17:58 ` Soheil Hassas Yeganeh
2020-11-17 19:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Ryan Sharpelletti @ 2020-11-16 17:44 UTC (permalink / raw)
To: David Miller
Cc: netdev, Ryan Sharpelletti, Neal Cardwell, Soheil Hassas Yeganeh,
Yuchung Cheng
From: Ryan Sharpelletti <sharpelletti@google.com>
During loss recovery, retransmitted packets are forced to use TCP
timestamps to calculate the RTT samples, which have a millisecond
granularity. BBR is designed using a microsecond granularity. As a
result, multiple RTT samples could be truncated to the same RTT value
during loss recovery. This is problematic, as BBR will not enter
PROBE_RTT if the RTT sample is <= the current min_rtt sample, meaning
that if there are persistent losses, PROBE_RTT will constantly be
pushed off and potentially never re-entered. This patch makes sure
that BBR enters PROBE_RTT by checking if RTT sample is < the current
min_rtt sample, rather than <=.
The Netflix transport/TCP team discovered this bug in the Linux TCP
BBR code during lab tests.
Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
Signed-off-by: Ryan Sharpelletti <sharpelletti@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
---
net/ipv4/tcp_bbr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
index 6c4d79baff26..6ea3dc2e4219 100644
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -945,7 +945,7 @@ static void bbr_update_min_rtt(struct sock *sk, const struct rate_sample *rs)
filter_expired = after(tcp_jiffies32,
bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ);
if (rs->rtt_us >= 0 &&
- (rs->rtt_us <= bbr->min_rtt_us ||
+ (rs->rtt_us < bbr->min_rtt_us ||
(filter_expired && !rs->is_ack_delayed))) {
bbr->min_rtt_us = rs->rtt_us;
bbr->min_rtt_stamp = tcp_jiffies32;
--
2.29.2.299.gdc1121823c-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate
2020-11-16 17:44 [PATCH net] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate Ryan Sharpelletti
@ 2020-11-16 17:58 ` Soheil Hassas Yeganeh
2020-11-17 19:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Soheil Hassas Yeganeh @ 2020-11-16 17:58 UTC (permalink / raw)
To: Ryan Sharpelletti
Cc: David Miller, netdev, Ryan Sharpelletti, Neal Cardwell,
Yuchung Cheng
LGTM. Thanks!
On Mon, Nov 16, 2020 at 12:44 PM Ryan Sharpelletti
<sharpelletti.kdev@gmail.com> wrote:
>
> From: Ryan Sharpelletti <sharpelletti@google.com>
>
> During loss recovery, retransmitted packets are forced to use TCP
> timestamps to calculate the RTT samples, which have a millisecond
> granularity. BBR is designed using a microsecond granularity. As a
> result, multiple RTT samples could be truncated to the same RTT value
> during loss recovery. This is problematic, as BBR will not enter
> PROBE_RTT if the RTT sample is <= the current min_rtt sample, meaning
> that if there are persistent losses, PROBE_RTT will constantly be
> pushed off and potentially never re-entered. This patch makes sure
> that BBR enters PROBE_RTT by checking if RTT sample is < the current
> min_rtt sample, rather than <=.
>
> The Netflix transport/TCP team discovered this bug in the Linux TCP
> BBR code during lab tests.
>
> Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
> Signed-off-by: Ryan Sharpelletti <sharpelletti@google.com>
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> ---
> net/ipv4/tcp_bbr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
> index 6c4d79baff26..6ea3dc2e4219 100644
> --- a/net/ipv4/tcp_bbr.c
> +++ b/net/ipv4/tcp_bbr.c
> @@ -945,7 +945,7 @@ static void bbr_update_min_rtt(struct sock *sk, const struct rate_sample *rs)
> filter_expired = after(tcp_jiffies32,
> bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ);
> if (rs->rtt_us >= 0 &&
> - (rs->rtt_us <= bbr->min_rtt_us ||
> + (rs->rtt_us < bbr->min_rtt_us ||
> (filter_expired && !rs->is_ack_delayed))) {
> bbr->min_rtt_us = rs->rtt_us;
> bbr->min_rtt_stamp = tcp_jiffies32;
> --
> 2.29.2.299.gdc1121823c-goog
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate
2020-11-16 17:44 [PATCH net] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate Ryan Sharpelletti
2020-11-16 17:58 ` Soheil Hassas Yeganeh
@ 2020-11-17 19:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-11-17 19:10 UTC (permalink / raw)
To: Ryan Sharpelletti; +Cc: davem, netdev, sharpelletti, ncardwell, soheil, ycheng
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Mon, 16 Nov 2020 17:44:13 +0000 you wrote:
> From: Ryan Sharpelletti <sharpelletti@google.com>
>
> During loss recovery, retransmitted packets are forced to use TCP
> timestamps to calculate the RTT samples, which have a millisecond
> granularity. BBR is designed using a microsecond granularity. As a
> result, multiple RTT samples could be truncated to the same RTT value
> during loss recovery. This is problematic, as BBR will not enter
> PROBE_RTT if the RTT sample is <= the current min_rtt sample, meaning
> that if there are persistent losses, PROBE_RTT will constantly be
> pushed off and potentially never re-entered. This patch makes sure
> that BBR enters PROBE_RTT by checking if RTT sample is < the current
> min_rtt sample, rather than <=.
>
> [...]
Here is the summary with links:
- [net] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate
https://git.kernel.org/netdev/net/c/1b9e2a8c99a5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-17 19:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-16 17:44 [PATCH net] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate Ryan Sharpelletti
2020-11-16 17:58 ` Soheil Hassas Yeganeh
2020-11-17 19:10 ` patchwork-bot+netdevbpf
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).