Patch "tcp_cubic: fix incorrect HyStart round start detection" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tcp_cubic: fix incorrect HyStart round start detection

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tcp_cubic-fix-incorrect-hystart-round-start-detectio.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5773731316ae914a2488235415a7aaf25d8a0776
Author: Mahdi Arghavani <ma.arghavani@xxxxxxxxx>
Date:   Fri Jan 17 21:37:51 2025 +0000

    tcp_cubic: fix incorrect HyStart round start detection
    
    [ Upstream commit 25c1a9ca53db5780757e7f53e688b8f916821baa ]
    
    I noticed that HyStart incorrectly marks the start of rounds,
    leading to inaccurate measurements of ACK train lengths and
    resetting the `ca->sample_cnt` variable. This inaccuracy can impact
    HyStart's functionality in terminating exponential cwnd growth during
    Slow-Start, potentially degrading TCP performance.
    
    The issue arises because the changes introduced in commit 4e1fddc98d25
    ("tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows")
    moved the caller of the `bictcp_hystart_reset` function inside the `hystart_update` function.
    This modification added an additional condition for triggering the caller,
    requiring that (tcp_snd_cwnd(tp) >= hystart_low_window) must also
    be satisfied before invoking `bictcp_hystart_reset`.
    
    This fix ensures that `bictcp_hystart_reset` is correctly called
    at the start of a new round, regardless of the congestion window size.
    This is achieved by moving the condition
    (tcp_snd_cwnd(tp) >= hystart_low_window)
    from before calling `bictcp_hystart_reset` to after it.
    
    I tested with a client and a server connected through two Linux software routers.
    In this setup, the minimum RTT was 150 ms, the bottleneck bandwidth was 50 Mbps,
    and the bottleneck buffer size was 1 BDP, calculated as (50M / 1514 / 8) * 0.150 = 619 packets.
    I conducted the test twice, transferring data from the server to the client for 1.5 seconds.
    Before the patch was applied, HYSTART-DELAY stopped the exponential growth of cwnd when
    cwnd = 516, and the bottleneck link was not yet saturated (516 < 619).
    After the patch was applied, HYSTART-ACK-TRAIN stopped the exponential growth of cwnd when
    cwnd = 632, and the bottleneck link was saturated (632 > 619).
    In this test, applying the patch resulted in 300 KB more data delivered.
    
    Fixes: 4e1fddc98d25 ("tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows")
    Signed-off-by: Mahdi Arghavani <ma.arghavani@xxxxxxxxx>
    Reviewed-by: Jason Xing <kerneljasonxing@xxxxxxxxx>
    Cc: Neal Cardwell <ncardwell@xxxxxxxxxx>
    Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
    Cc: Haibo Zhang <haibo.zhang@xxxxxxxxxxx>
    Cc: David Eyers <david.eyers@xxxxxxxxxxx>
    Cc: Abbas Arghavani <abbas.arghavani@xxxxxx>
    Reviewed-by: Neal Cardwell <ncardwell@xxxxxxxxxx>
    Tested-by: Neal Cardwell <ncardwell@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index af4fc067f2a19..741a15799ab35 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -390,6 +390,10 @@ static void hystart_update(struct sock *sk, u32 delay)
 	if (after(tp->snd_una, ca->end_seq))
 		bictcp_hystart_reset(sk);
 
+	/* hystart triggers when cwnd is larger than some threshold */
+	if (tcp_snd_cwnd(tp) < hystart_low_window)
+		return;
+
 	if (hystart_detect & HYSTART_ACK_TRAIN) {
 		u32 now = bictcp_clock_us(sk);
 
@@ -465,9 +469,7 @@ static void cubictcp_acked(struct sock *sk, const struct ack_sample *sample)
 	if (ca->delay_min == 0 || ca->delay_min > delay)
 		ca->delay_min = delay;
 
-	/* hystart triggers when cwnd is larger than some threshold */
-	if (!ca->found && tcp_in_slow_start(tp) && hystart &&
-	    tcp_snd_cwnd(tp) >= hystart_low_window)
+	if (!ca->found && tcp_in_slow_start(tp) && hystart)
 		hystart_update(sk, delay);
 }
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux