CoDel AQM discussions
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>
Cc: Paolo Valente <paolo.valente@unimore.it>,
	"codel@lists.bufferbloat.net" <codel@lists.bufferbloat.net>,
	"cerowrt-devel@lists.bufferbloat.net"
	<cerowrt-devel@lists.bufferbloat.net>,
	bloat <bloat@lists.bufferbloat.net>,
	paulmck@linux.vnet.ibm.com, John Crispin <blogic@openwrt.org>
Subject: Re: [Codel] [Bloat] [Cerowrt-devel] FQ_Codel lwn draft article review
Date: Sun, 02 Dec 2012 14:07:49 -0800	[thread overview]
Message-ID: <1354486069.20109.1206.camel@edumazet-glaptop> (raw)
In-Reply-To: <87vcckb0el.fsf@toke.dk>

On Sun, 2012-12-02 at 22:37 +0100, Toke Høiland-Jørgensen wrote:
> Eric Dumazet <eric.dumazet@gmail.com> writes:
> 
> > This can help if you really want to avoid a thick flow sharing a thin
> > flow bucket, but given that all packets are going eventually into the
> > Internet (or equivalent crowded network), its not really a clear win.
> 
> I've been trying to grok the fq_codel code by reading through it while
> following the discussion in the article, and I'm having a bit of trouble
> squaring the thin/thick (or "hog"/"non-hog") flow designation of the
> article with the code. As far as I can tell from the code, there are two
> lists, called new_flows and old_flows; and a flow starts out as 'new'
> and stays that way until it has sent a quantum of bytes or codel fails
> to dequeue a packet from it, whereupon it is moved to the end of the
> old_flows list. It then stays in the old_flows list for the rest of its
> "life".

Not at all.

If a cell has :
  - a positive credit/deficit
  - no more packets to send
Then 
  if is part of old_flows list, we remove it
  else we move it from new_flows to old_flows


The algo has a special shortcut to avoid a pass to old_flows if
old_flows is empty, but thats basically :

                /* force a pass through old_flows to prevent starvation */
                if (head == &q->new_flows)
                        list_move_tail(&flow->flowchain, &q->old_flows);
                else
                        list_del_init(&flow->flowchain);


Next time a packet re-activates the flow (or more exactly the bucket in
hash table), we move it to 'new_flows' only for one quantum.

> 
> Now, talking about thin flows being distinguished from thick ones, it
> seems to me that if a flow sends packets at a low enough rate it can in
> principle stay 'thin' indefinitely. So I'm assuming I've missed
> something in the code that allows a flow to stay in the new_flows list
> if it is sufficiently thin. Could someone please point out to me what
> I'm missing? :)
> 

I dont know, this new_flow/old_flows seems too hard to understand for
most readers of the code.

I saw many people confused by this algo.

Of course, a thin flow stay thin, if the bucket can be in the following
states, forever :

- empty
- packet arrives -> bucket queued to end of new_flows
- packet is dequeued.
- as bucket is empty, move bucket to end of old_flows
- next time we hit this bucket (because we processed all packets from
old_flows), we remove it from the list and its state becomes 'empty'

If the next packet arrives while the bucket is still in old_flows,
we wont put the bucket in new_flow, its bucket have to wait its turn in
the RR list.

Think of it this way : If a bucket lost its turn in the RRR mechanism
and became idle, it has its deficit refilled to 'q->quantum', and it has
the right to be elected as a new_flow next time a packet wants to use
this bucket.




  parent reply	other threads:[~2012-12-02 22:07 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAA93jw5yFvrOyXu2s2DY3oK_0v3OaNfnL+1zTteJodfxtAAzcQ@mail.gmail.com>
2012-11-23  8:57 ` [Codel] " Dave Taht
2012-11-23 22:18   ` Paul E. McKenney
2012-11-24  0:07     ` Toke Høiland-Jørgensen
2012-11-24 16:19       ` Dave Taht
2012-11-24 16:36         ` [Codel] [Cerowrt-devel] " dpreed
2012-11-24 19:57         ` [Codel] " Andrew McGregor
2012-11-26 21:13         ` Rick Jones
2012-11-26 21:19           ` Dave Taht
2012-11-26 22:16         ` Toke Høiland-Jørgensen
2012-11-26 23:21           ` Toke Høiland-Jørgensen
2012-11-26 23:39             ` [Codel] [Cerowrt-devel] " dpreed
2012-11-26 23:58               ` Toke Høiland-Jørgensen
2012-11-26 17:20       ` [Codel] " Paul E. McKenney
2012-11-26 21:05       ` Rick Jones
2012-11-26 23:18         ` [Codel] [Bloat] " Rick Jones
2012-11-27 22:03     ` [Codel] [Cerowrt-devel] " Jim Gettys
2012-11-27 22:31       ` [Codel] [Bloat] " David Lang
2012-11-27 22:54         ` Paul E. McKenney
2012-11-27 23:15           ` Andrew McGregor
2012-11-28  0:51             ` Paul E. McKenney
2012-11-28 17:36             ` Paul E. McKenney
2012-11-28 14:06         ` [Codel] [Cerowrt-devel] [Bloat] " Michael Richardson
2012-11-27 22:49       ` [Codel] [Cerowrt-devel] " Paul E. McKenney
2012-11-27 23:53         ` Greg White
2012-11-28  0:27           ` Paul E. McKenney
2012-11-28  3:43             ` Kathleen Nichols
2012-11-28  4:38               ` Paul E. McKenney
2012-11-28 16:01                 ` Paul E. McKenney
2012-11-28 16:16                   ` Jonathan Morton
2012-11-28 17:44                     ` Paul E. McKenney
2012-11-28 18:37                       ` [Codel] [Bloat] " Michael Richardson
2012-11-28 18:51                         ` Eric Dumazet
2012-11-28 21:44                           ` Michael Richardson
2012-11-28 19:00                       ` Eric Dumazet
2012-12-02 21:37                         ` Toke Høiland-Jørgensen
2012-12-02 21:47                           ` Andrew McGregor
2012-12-03  8:04                             ` Dave Taht
2012-12-02 22:07                           ` Eric Dumazet [this message]
2012-12-02 22:15                             ` Toke Høiland-Jørgensen
2012-12-02 22:30                               ` Eric Dumazet
2012-12-02 22:51                                 ` Toke Høiland-Jørgensen
2012-11-28 17:20       ` [Codel] " Paul E. McKenney
2012-12-02 23:06         ` Paul E. McKenney
2012-12-03 11:24           ` Toke Høiland-Jørgensen
2012-12-03 11:31             ` Dave Taht
2012-12-03 12:54               ` Toke Høiland-Jørgensen
2012-12-03 14:58                 ` Paul E. McKenney
2012-12-03 15:19                   ` Toke Høiland-Jørgensen
2012-12-03 15:49                   ` Eric Dumazet
2012-12-03 15:03               ` Paul E. McKenney
2012-12-03 15:58               ` David Woodhouse
2012-12-04  3:13                 ` Dan Siemon
2012-12-05  0:01                   ` Sebastian Moeller
     [not found]                   ` <1354613026.72238.YahooMailNeo@web126202.mail.ne1.yahoo.com>
2012-12-05  3:41                     ` [Codel] [Bloat] " Dan Siemon
     [not found]                       ` <1354739624.4431.YahooMailNeo@web126205.mail.ne1.yahoo.com>
2012-12-06  4:12                         ` Dan Siemon
2012-11-30  1:09       ` Dan Siemon

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

  List information: https://lists.bufferbloat.net/postorius/lists/codel.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354486069.20109.1206.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=bloat@lists.bufferbloat.net \
    --cc=blogic@openwrt.org \
    --cc=cerowrt-devel@lists.bufferbloat.net \
    --cc=codel@lists.bufferbloat.net \
    --cc=paolo.valente@unimore.it \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=toke@toke.dk \
    /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