From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: David Miller <davem@davemloft.net>,
Patrick McHardy <kaber@trash.net>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next-2.6] sch_sfq: allow big packets and be fair
Date: Tue, 21 Dec 2010 11:57:17 +0100 [thread overview]
Message-ID: <1292929037.2720.12.camel@edumazet-laptop> (raw)
In-Reply-To: <20101221101506.GA8149@ff.dom.local>
Le mardi 21 décembre 2010 à 10:15 +0000, Jarek Poplawski a écrit :
> On 2010-12-21 00:16, Eric Dumazet wrote:
> > SFQ is currently 'limited' to small packets, because it uses a 16bit
> > allotment number per flow. Switch it to 18bit, and use appropriate
> > handling to make sure this allotment is in [1 .. quantum] range before a
> > new packet is dequeued, so that fairness is respected.
>
> Well, such two important changes should be in separate patches.
>
> The change of allotment limit looks OK (but I would try scaling, e.g.
> in 16-byte chunks, btw).
>
Hmm, we could scale by 2 or 3 and keep 16bit allot/hash (faster than
18/14 bit bitfields on x86). Not sure its worth it (it adds two shifts
per packet)
> The change in fair treatment looks dubious. A flow which uses exactly
> it's quantum in one round will be skipped in the next round. A flow
> which uses a bit more than its quantum in one round, will be skipped
> too, while we should only give it less this time to keep the sum up to
> 2 quantums. (The usual algorithm is to check if a flow has enough
> "tickets" for sending its next packet.)
Hmm...
A flow which uses exactly its quantum in one round wont be skipped in
the next round.
I only made the "I pass my round to next slot in chain" in one place
instead of two, maybe you missed the removal at the end of
sfq_dequeue() ?
- } else if ((slot->allot -= qdisc_pkt_len(skb)) <= 0) {
- q->tail = slot;
- slot->allot += q->quantum;
+ } else {
+ slot->allot -= qdisc_pkt_len(skb);
}
Now the check is performed at the beginning of sfq_dequeue(), to be able
to charge a previously sent 'big packet' multiple times (faulty flow
wont send a packet before passing xx rounds)
I believe I just did the right thing. The "allot" is incremented when
current flow "pass its round to next slot", and decremented when a
packet is dequeued from this slot. Before being allowed to dequeue a
packet, "allot" must be 'positive'.
next prev parent reply other threads:[~2010-12-21 10:57 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 14:03 [PATCH] net_sched: sch_sfq: fix allot handling Eric Dumazet
2010-12-15 16:03 ` Patrick McHardy
2010-12-15 16:27 ` Eric Dumazet
2010-12-15 16:40 ` [PATCH v2] " Eric Dumazet
2010-12-15 16:43 ` Patrick McHardy
2010-12-15 16:55 ` Eric Dumazet
2010-12-15 17:03 ` Patrick McHardy
2010-12-15 17:09 ` Eric Dumazet
2010-12-15 17:21 ` Patrick McHardy
2010-12-15 17:30 ` [PATCH v3] " Eric Dumazet
2010-12-15 18:18 ` [PATCH net-next-2.6] net_sched: sch_sfq: add backlog info in sfq_dump_class_stats() Eric Dumazet
2010-12-15 19:10 ` Eric Dumazet
2010-12-16 8:16 ` Jarek Poplawski
2010-12-16 10:18 ` [PATCH v2 " Eric Dumazet
2010-12-16 11:03 ` [PATCH " Eric Dumazet
2010-12-16 13:09 ` Jarek Poplawski
2010-12-20 21:14 ` David Miller
2010-12-20 21:18 ` [PATCH v3] net_sched: sch_sfq: fix allot handling David Miller
2010-12-16 13:08 ` [PATCH v2] " Eric Dumazet
2010-12-17 16:52 ` [RFC PATCH] net_sched: sch_sfq: better struct layouts Eric Dumazet
2010-12-19 21:22 ` Jarek Poplawski
2010-12-20 17:02 ` [PATCH v2] " Eric Dumazet
2010-12-20 21:33 ` David Miller
2010-12-20 21:42 ` Eric Dumazet
2010-12-20 22:54 ` [PATCH v3 net-next-2.6] " Eric Dumazet
2010-12-21 5:33 ` David Miller
2010-12-20 22:55 ` [PATCH v2] " Jarek Poplawski
2010-12-20 23:16 ` [PATCH net-next-2.6] sch_sfq: allow big packets and be fair Eric Dumazet
2010-12-21 10:15 ` Jarek Poplawski
2010-12-21 10:30 ` Jarek Poplawski
2010-12-21 10:44 ` Eric Dumazet
2010-12-21 10:56 ` Jarek Poplawski
2010-12-21 10:57 ` Eric Dumazet [this message]
2010-12-21 11:39 ` Jarek Poplawski
2010-12-21 12:17 ` Jarek Poplawski
2010-12-21 13:04 ` [PATCH v2 " Eric Dumazet
2010-12-21 13:47 ` Jarek Poplawski
2010-12-28 21:46 ` David Miller
2010-12-29 7:53 ` [PATCH v3 " Eric Dumazet
2010-12-31 20:48 ` David Miller
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=1292929037.2720.12.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=jarkao2@gmail.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
/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