From: Stephen Hemminger <hidden> Date: 2011-03-14 18:02:03
This is the merge of my patches and recent update Sangtae.
It addresses the problems reported by Lucas Nussbaum that Hystart causes
poor startup performance over links with lots of buffering.
From: Stephen Hemminger <hidden> Date: 2011-03-14 18:02:03
Jiffies wraps around therefore the correct way to compare is
to use cast to signed value.
Note: cubic is not using full jiffies value on 64 bit arch
because using full unsigned long makes struct bictcp grow too
large for the available ca_priv area.
Includes correction from Sangtae Ha to improve ack train detection.
Signed-off-by: Stephen Hemminger <redacted>
From: Stephen Hemminger <hidden> Date: 2011-03-14 18:02:03
In the congestion control interface, the callback for each ACK
includes an estimated round trip time in microseconds.
Some algorithms need high resolution (Vegas style) but most only
need jiffie resolution. If RTT is not accurate (like a retransmission)
-1 is used as a flag value.
When doing coarse resolution if RTT is less than a a jiffie
then 0 should be returned rather than no estimate. Otherwise algorithms
that expect good ack's to trigger slow start (like CUBIC Hystart)
will be confused.
Signed-off-by: Stephen Hemminger <redacted>
From: Stephen Hemminger <hidden> Date: 2011-03-14 18:02:03
The hystart code was written with assumption that HZ=1000.
Replace the use of jiffies with bictcp_clock as a millisecond
real time clock.
Signed-off-by: Stephen Hemminger <redacted>
Reported-by: Lucas Nussbaum <redacted>
@@ -88,7 +88,7 @@ struct bictcp {u32last_time;/* time when updated last_cwnd */u32bic_origin_point;/* origin point of bic function */u32bic_K;/* time to origin point from the beginning of the current epoch */-u32delay_min;/* min delay */+u32delay_min;/* min delay (msec << 3) */u32epoch_start;/* beginning of an epoch */u32ack_cnt;/* number of acks */u32tcp_cwnd;/* estimated tcp cwnd */
@@ -98,7 +98,7 @@ struct bictcp {u8found;/* the exit point is found? */u32round_start;/* beginning of each round */u32end_seq;/* end_seq of the round */-u32last_jiffies;/* last time when the ACK spacing is close */+u32last_ack;/* last time when the ACK spacing is close */u32curr_rtt;/* the minimum rtt of current round */};
@@ -239,8 +248,8 @@ static inline void bictcp_update(struct*//* change the unit from HZ to bictcp_HZ */-t=((tcp_time_stamp+(ca->delay_min>>3)-ca->epoch_start)-<<BICTCP_HZ)/HZ;+t=((tcp_time_stamp+msecs_to_jiffies(ca->delay_min>>3)+-ca->epoch_start)<<BICTCP_HZ)/HZ;if(t<ca->bic_K)/* t - K */offs=ca->bic_K-t;
From: Stephen Hemminger <hidden> Date: 2011-03-14 18:02:04
This is a refined version of an earlier patch by Lucas Nussbaum.
Cubic needs RTT values in milliseconds. If HZ < 1000 then
the values will be too coarse.
Signed-off-by: Stephen Hemminger <redacted>
Reported-by: Lucas Nussbaum <redacted>
@@ -459,6 +459,10 @@ static int __init cubictcp_register(void/* divide by bic_scale and by constant Srtt (100ms) */do_div(cube_factor,bic_scale*10);+/* hystart needs ms clock resolution */+if(hystart&&HZ<1000)+cubictcp.flags|=TCP_CONG_RTT_STAMP;+returntcp_register_congestion_control(&cubictcp);}
From: Stephen Hemminger <hidden> Date: 2011-03-14 18:02:04
From: Sangtae Ha <redacted>
HyStart sets the initial exit point of slow start.
Suppose that HyStart exits at 0.5BDP in a BDP network and no history exists.
If the BDP of a network is large, CUBIC's initial cwnd growth may be
too conservative to utilize the link.
CUBIC increases the cwnd 20% per RTT in this case.
Signed-off-by: Sangtae Ha <redacted>
Acked-by: Stephen Hemminger <redacted>
---
net/ipv4/tcp_cubic.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
From: Stephen Hemminger <hidden> Date: 2011-03-14 18:02:04
From: Sangtae Ha <redacted>
Make HyStart less sensitive to abrupt delay variations due to buffer bloat.
Signed-off-by: Sangtae Ha <redacted>
Acked-by: Stephen Hemminger <redacted>
Reported-by: Lucas Nussbaum <redacted>
---
net/ipv4/tcp_cubic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
From: Eric Dumazet <hidden> Date: 2011-03-14 18:52:31
Le lundi 14 mars 2011 à 10:52 -0700, Stephen Hemminger a écrit :
quoted hunk
pièce jointe document texte brut (tcp-cubic-minrtt.patch)
The hystart code was written with assumption that HZ=1000.
Replace the use of jiffies with bictcp_clock as a millisecond
real time clock.
Signed-off-by: Stephen Hemminger <redacted>
Reported-by: Lucas Nussbaum <redacted>
@@ -88,7 +88,7 @@ struct bictcp {u32last_time;/* time when updated last_cwnd */u32bic_origin_point;/* origin point of bic function */u32bic_K;/* time to origin point from the beginning of the current epoch */-u32delay_min;/* min delay */+u32delay_min;/* min delay (msec << 3) */u32epoch_start;/* beginning of an epoch */u32ack_cnt;/* number of acks */u32tcp_cwnd;/* estimated tcp cwnd */
@@ -98,7 +98,7 @@ struct bictcp {u8found;/* the exit point is found? */u32round_start;/* beginning of each round */u32end_seq;/* end_seq of the round */-u32last_jiffies;/* last time when the ACK spacing is close */+u32last_ack;/* last time when the ACK spacing is close */u32curr_rtt;/* the minimum rtt of current round */};
From: Stephen Hemminger <hidden> Date: 2011-03-14 21:21:27
On Mon, 14 Mar 2011 19:51:19 +0100
Eric Dumazet [off-list ref] wrote:
Le lundi 14 mars 2011 à 10:52 -0700, Stephen Hemminger a écrit :
quoted
pièce jointe document texte brut (tcp-cubic-minrtt.patch)
The hystart code was written with assumption that HZ=1000.
Replace the use of jiffies with bictcp_clock as a millisecond
real time clock.
Signed-off-by: Stephen Hemminger <redacted>
Reported-by: Lucas Nussbaum <redacted>
@@ -88,7 +88,7 @@ struct bictcp {u32last_time;/* time when updated last_cwnd */u32bic_origin_point;/* origin point of bic function */u32bic_K;/* time to origin point from the beginning of the current epoch */-u32delay_min;/* min delay */+u32delay_min;/* min delay (msec << 3) */u32epoch_start;/* beginning of an epoch */u32ack_cnt;/* number of acks */u32tcp_cwnd;/* estimated tcp cwnd */
@@ -98,7 +98,7 @@ struct bictcp {u8found;/* the exit point is found? */u32round_start;/* beginning of each round */u32end_seq;/* end_seq of the round */-u32last_jiffies;/* last time when the ACK spacing is close */+u32last_ack;/* last time when the ACK spacing is close */u32curr_rtt;/* the minimum rtt of current round */};
From: David Miller <davem@davemloft.net> Date: 2011-03-14 22:57:27
From: Stephen Hemminger <redacted>
Date: Mon, 14 Mar 2011 10:52:11 -0700
This is the merge of my patches and recent update Sangtae.
It addresses the problems reported by Lucas Nussbaum that Hystart causes
poor startup performance over links with lots of buffering.
Ok, I've applied all of this to net-2.6 and did test builds with HZ={100,250,1000}
on both sparc64 and x86.
I'll let it cook for a day or two before pushing it out to Linus.
From: Lucas Nussbaum <hidden> Date: 2011-03-22 11:35:44
On 14/03/11 at 10:52 -0700, Stephen Hemminger wrote:
This is the merge of my patches and recent update Sangtae.
It addresses the problems reported by Lucas Nussbaum that Hystart causes
poor startup performance over links with lots of buffering.
Hi,
I've tested the patches, and they work fine.
Here are some results (gigabit link, RTT=11ms).
Without the patches, hystart disabled:
Segments (cwnd, ssthresh)
2500 ++-----------+-------------+------------+-------------+-----------++
+ + + + snd_cwnd ****** +
| snd_ssthresh ###### |
2000 ++ ************************************************* ++
| ** |
| * |
| * |
1500 ++ * ++
| * |
| * |
1000 ++ * ++
| ** |
| * |
| * |
500 ++ * ++
| ** |
+ ** + + + + +
0 ++-***####################################################--------++
0 0.5 1 1.5 2 2.5
time (seconds)
Without the patches, hystart enabled:
Segments (cwnd, ssthresh)
300 ++------------+------------+-------------+------------+------------++
+ + + + snd_cwnd ****** +
| ***snd_ssthresh ###### |
250 ++ *********************** ++
| ******************################################### |
| * |
200 ++ * ++
| * |
150 ++ * ++
| * |
| * |
100 ++ ** ++
| *# |
| *# |
50 ++ *# ++
| **# |
+ ** # + + + + +
0 ++-*###-------+------------+-------------+------------+------------++
0 0.5 1 1.5 2 2.5
time (seconds)
Note how slow start ends very early (~ 230 segments), resulting in poor performance.
With the patches, hystart enabled, run 1:
Segments (cwnd, ssthresh)
2500 ++-----+-------+------+-------+------+-------+------+-------+-----++
+ + + + + + + snd_cwnd ****** +
| snd_ssthresh ###### |
2000 ++ ********************************************************* ++
| * |
| * |
| * |
1500 ++ * ++
| * |
| ** |
1000 ++ * ++
| * |
| * |
| * |
500 ++ * ++
| ** |
+ * + + + + + + + + +
0 ++**##########################################################----++
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
time (seconds)
There's no perceived delay increase, but also no losses. The NIC sends data at
line rate without congestion. we don't exit slow start, but that's fine:
With the patch, hystart enabled, run 2: (that's the most frequent situation)
Segments (cwnd, ssthresh)
2500 ++-----+-------+------+-------+------+-------+------+-------+-----++
+ + + + + + + snd_cwnd ****** +
| snd_ssthresh ###### |
2000 ++ ******************************************************** ++
| *# |
| *# |
| *# |
1500 ++ *# ++
| *# |
| *# |
1000 ++ **# ++
| * # |
| * # |
| * # |
500 ++ ** # ++
| * # |
+ ** # + + + + + + + +
0 ++**####-------+------+-------+------+-------+------+-------+-----++
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
time (seconds)
Hystart detects a delay increase, so we exit slow start, but at a reasonable point.
Hystart works fine in that case. (no impact on performance).
With the patch, hystart enabled, run 3:
Segments (cwnd, ssthresh)
2500 ++-----+-------+------+-------+------+-------+------+-------+-----++
+ + + + + + + snd_cwnd ****** +
| snd_ssthresh ###### |
2000 ++ ******************************************************* ++
| * |
| ** |
| * |
1500 ++ **####################################################### ++
| *# |
| *# |
1000 ++ *# ++
| *# |
| **# |
| * # |
500 ++ * # ++
| * # |
+ ** #+ + + + + + + + +
0 ++**###+-------+------+-------+------+-------+------+-------+-----++
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
time (seconds)
Hystart causes slow start to end a bit too early, but late enough not to affect
performance significantly. Hystart behaves fine in that case too.
Tested-By: Lucas Nussbaum <redacted>
--
| Lucas Nussbaum MCF Université Nancy 2 |
| lucas.nussbaum@loria.fr LORIA / AlGorille |
| http://www.loria.fr/~lnussbau/ +33 3 54 95 86 19 |
From: Lucas Nussbaum <hidden> Date: 2011-03-22 11:35:44
On 14/03/11 at 10:52 -0700, Stephen Hemminger wrote:
This is the merge of my patches and recent update Sangtae.
It addresses the problems reported by Lucas Nussbaum that Hystart causes
poor startup performance over links with lots of buffering.
What do you plan to do regarding stable kernels? We should probably
either push that patch serie, or disable hystart if HZ < 1000.
--
| Lucas Nussbaum MCF Université Nancy 2 |
| lucas.nussbaum@loria.fr LORIA / AlGorille |
| http://www.loria.fr/~lnussbau/ +33 3 54 95 86 19 |
From: David Miller <davem@davemloft.net> Date: 2011-03-22 12:04:28
From: Lucas Nussbaum <redacted>
Date: Tue, 22 Mar 2011 12:35:42 +0100
On 14/03/11 at 10:52 -0700, Stephen Hemminger wrote:
quoted
This is the merge of my patches and recent update Sangtae.
It addresses the problems reported by Lucas Nussbaum that Hystart causes
poor startup performance over links with lots of buffering.
What do you plan to do regarding stable kernels? We should probably
either push that patch serie, or disable hystart if HZ < 1000.
I think once the patch series gets some soaking time in Linus's tree
we can send it over to -stable.