From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [RFC] sched: CHOKe packet scheduler (v0.2)
Date: Thu, 06 Jan 2011 05:07:30 +0100 [thread overview]
Message-ID: <1294286850.2723.65.camel@edumazet-laptop> (raw)
In-Reply-To: <20110105112104.64ad3c86@nehalam>
Le mercredi 05 janvier 2011 à 11:21 -0800, Stephen Hemminger a écrit :
> This implements the CHOKe packet scheduler based on the existing
> Linux RED scheduler based on the algorithm described in the paper.
>
> The core idea is:
> For every packet arrival:
> Calculate Qave
> if (Qave < minth)
> Queue the new packet
> else
> Select randomly a packet from the queue
> if (both packets from same flow)
> then Drop both the packets
> else if (Qave > maxth)
> Drop packet
> else
> Admit packet with probability p (same as RED)
>
> See also:
> Rong Pan, Balaji Prabhakar, Konstantinos Psounis, "CHOKe: a stateless active
> queue management scheme for approximating fair bandwidth allocation",
> Proceeding of INFOCOM'2000, March 2000.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
To be really useful in a wide range of environments, I believe that :
- CHOKe should be able to use an external flow classifier (like say...
SFQ) to compute a token and compare two skbs by this token instead of
custom rxhash or whatever. (rxhash can be the default in absence of flow
classifier). Probably you need to store the token in skb->cb[] to avoid
calling tc_classify() several times for a given packet.
http://lwn.net/Articles/236200/
http://kerneltrap.org/mailarchive/linux-netdev/2008/1/31/667679
- Must use a FIFO with O(1) access to Nth skb in queue.
A linked list makes this implementation too expensive for big queues.
For small queues (less than 128 skbs at this moment for SFQ), existing
schedulers are good enough.
CHOKe authors dont mention this in their paper, but their experiments
were done in 1999 with 1Mbs links. minth=100 and maxth=200, limit=300
We want to try CHOKe with modern links, probably with minth=2000 and
maxth=4000 or more.
They said "It is arguably more difficult to drop a randomy chosen packet
since this means removing from a linked-list. Instead of doing this, we
propose to add one extra bit to the packet header. The bit is set to one
if the drop candidate is to be dropped. When a packet advance to the
head of the FIFO buffer, the status of the bit determines whether it is
to be immediately discarded or transmitted on the outgoind line"
If they thought removing a buffer from a linked list was expensive
(!!!), they certainly assumed the previous access to the randomly chosen
buffer was faster than the skb unlink !
Using a circular buffer should be enough, using a similar trick than
suggested : when droping an skb from the ring, stick a NULL pointer and
dont memmove() the window to shrink it.
struct skb_ring {
unsigned int head;
unsigned int tail;
unsigned int size; /* a power of two */
struct sk_buff **table;
};
Doing so avoids the cache misses to adjacent skbs prev/next when
queue/dequeue is done.
next prev parent reply other threads:[~2011-01-06 4:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 0:29 [RFC] sched: CHOKe packet scheduler Stephen Hemminger
2011-01-05 6:02 ` Eric Dumazet
2011-01-05 6:19 ` Eric Dumazet
2011-01-05 17:17 ` Stephen Hemminger
2011-01-05 17:25 ` Eric Dumazet
2011-01-05 19:21 ` [RFC] sched: CHOKe packet scheduler (v0.2) Stephen Hemminger
2011-01-05 20:06 ` Eric Dumazet
2011-01-05 20:15 ` Stephen Hemminger
2011-01-06 4:07 ` Eric Dumazet [this message]
2011-01-06 6:53 ` Stephen Hemminger
2011-01-07 4:55 ` Stephen Hemminger
2011-01-07 5:39 ` Changli Gao
2011-01-07 7:10 ` Stephen Hemminger
2011-01-07 8:37 ` Eric Dumazet
2011-01-10 13:46 ` Eric Dumazet
2011-01-10 17:31 ` Stephen Hemminger
2011-01-10 17:45 ` Eric Dumazet
2011-01-10 23:44 ` [RFC] sched: CHOKe packet scheduler (v0.4) Stephen Hemminger
2011-01-11 0:00 ` Eric Dumazet
2011-01-11 1:10 ` Stephen Hemminger
2011-01-11 6:18 ` Eric Dumazet
2011-01-11 6:34 ` Eric Dumazet
2011-01-11 23:48 ` Stephen Hemminger
2011-01-12 0:04 ` Eric Dumazet
2011-01-12 7:13 ` [RFC] sched: CHOKe packet scheduler (v0.6) Eric Dumazet
2011-01-12 17:27 ` Stephen Hemminger
2011-01-12 17:33 ` Eric Dumazet
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=1294286850.2723.65.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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