Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>,
	David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Tom Herbert <therbert@google.com>,
	Stephen Hemminger <shemminger@vyatta.com>,
	John Heffner <johnwheffner@gmail.com>,
	Nandita Dukkipati <nanditad@google.com>
Subject: Re: [PATCH v2 net-next] tcp: fix ABC in tcp_slow_start()
Date: Fri, 20 Jul 2012 18:08:56 +0200	[thread overview]
Message-ID: <1342800536.2626.7670.camel@edumazet-glaptop> (raw)
In-Reply-To: <CADVnQy=nJz33pzd+o1WoCOR6Mk2pbB2x+bujqbfLUi8-+J=hGA@mail.gmail.com>

On Fri, 2012-07-20 at 09:03 -0700, Neal Cardwell wrote:
> On Fri, Jul 20, 2012 at 8:07 AM, Yuchung Cheng <ycheng@google.com> wrote:
> > On Fri, Jul 20, 2012 at 8:02 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >>         tp->snd_cwnd_cnt += cnt;
> >>         while (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
> 
> Nice catch, Eric.
> 
> One thing that's always bothered me about the tp->snd_cwnd_cnt code is
> that the slow start and congestion avoidance use different criteria
> for incrementing snd_cwnd_cnt. tcp_slow_start() increments
> snd_cwnd_cnt by snd_cwnd for each ACKed packet, and congestion
> avoidance increases snd_cwnd_cnt by just 1 for each packet.
> 
> This means that if we exit slow start and enter congestion avoidance,
> then we think we can have a "credit" for a bunch of ACKs that never
> happened (up to snd_cwnd-1), so we can conceivably do our first
> additive increase in congestion avoidance up to almost 1RTT too
> early. Can we just get rid of the use of snd_cwnd_cnt in slow start,
> and just use local variables in tcp_slow_start() rather than trying to
> carry state between ACKs?

Apparently tcp_slow_start() needs the snd_cwnd_cnt in case 
"limited slow start"  is used :

cnt = sysctl_tcp_max_ssthresh >> 1;

So to address your point, maybe we should clear  snd_cwnd_cnt
when leaving slow start for congestion avoidance phase ?

  reply	other threads:[~2012-07-20 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 15:02 [PATCH v2 net-next] tcp: fix ABC in tcp_slow_start() Eric Dumazet
2012-07-20 15:07 ` Yuchung Cheng
2012-07-20 16:03   ` Neal Cardwell
2012-07-20 16:08     ` Eric Dumazet [this message]
2012-07-20 16:50       ` Neal Cardwell
2012-07-20 17:58   ` Neal Cardwell
2012-07-20 18:01     ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2012-07-20 18:01 Stephen Hemminger
2012-07-20 18:02 ` David Miller
2012-07-20 18:13   ` Neal Cardwell

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=1342800536.2626.7670.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=johnwheffner@gmail.com \
    --cc=nanditad@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=therbert@google.com \
    --cc=ycheng@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