From: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
To: <cake@lists.bufferbloat.net>
Subject: [Cake] cake, codel5.h, ecn marking & dropping. Confused
Date: Wed, 4 May 2016 10:57:52 +0100 [thread overview]
Message-ID: <5729C7A0.40600@darbyshire-bryant.me.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 4553 bytes --]
Hi All,
As a result of Eric's recent change to fq_codel which, to use an
analogy, when being subject to loads of sh*t, it's better to use a
shovel to get rid of it rather than a teaspoon, I started having a nose
deeper into cake than I've ever gone before. I was also interested to
note that one of Dave's recent tests where cake was using lots of CPU
but apparently cake wasn't getting into its own 'buffer full, discard at
enqueue' mode. That sort of suggests the dequeue process was the thing
using all the CPU, possibly starving the process generating packets so
the buffer never filled.
So, in the context of I'm an ignorant buffoon, I'm wondering what I'm
misunderstanding from the following extract of code: codel5.h, line 358
if (!skb) {
vars->dropping = false;
return skb;
}
drop = codel_should_drop(skb, sch, vars, p, now, overloaded);
if (vars->dropping) {
if (!drop) {
/* sojourn time below target - leave dropping
state */
vars->dropping = false;
} else if (now >= vars->drop_next) {
/* It's time for the next drop. Drop the current
* packet and dequeue the next. The dequeue might
* take us out of dropping state.
* If not, schedule the next drop.
* A large backlog might result in drop rates so
high
* that the next drop should happen now,
* hence the while loop.
*/
/* saturating increment */
vars->count++;
if (!vars->count)
vars->count--;
codel_Newton_step(vars);
vars->drop_next = codel_control_law(vars->drop_next,
p->interval,
vars->rec_inv_sqrt);
do {
if (INET_ECN_set_ce(skb)) {
vars->ecn_mark++;
/* and schedule the next drop */
vars->drop_next = codel_control_law(
vars->drop_next,
p->interval,
vars->rec_inv_sqrt);
goto end;
}
qdisc_drop(skb, sch);
vars->drop_count++;
skb = custom_dequeue(vars, sch);
if (skb && !codel_should_drop(skb, sch,
vars,
p, now,
overloaded)) {
/* leave dropping state */
vars->dropping = false;
} else {
/* schedule the next drop */
vars->drop_next = codel_control_law(
vars->drop_next,
p->interval,
vars->rec_inv_sqrt);
}
} while (skb && vars->dropping && now >=
vars->drop_next);
/* Mark the packet regardless */
if (skb && INET_ECN_set_ce(skb))
vars->ecn_mark++;
}
In essence my (mis)understanding of this code is something like: We've
got here because we've been dropping and codel is telling is to continue
to drop. With that decided we enter a do..while, the first thing to
happen is to ECN mark and let that marked packet escape to send the
signal. Otherwise we appear to iterate around the loop. So here's the
nub of my question: the INET_ECN_set_ce is done on every iteration of
that loop...with its potential early escape..do we escape on every
iteration? Do we need to twiddle the ECN bits on every packet that
we're about to drop? And we seem to mark the packet on exit of the loop
anyway.
I'm confused but almost certainly because I'm an idiot.
Kevin
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4816 bytes --]
next reply other threads:[~2016-05-04 9:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-04 9:57 Kevin Darbyshire-Bryant [this message]
2016-05-04 11:41 ` Jonathan Morton
2016-05-04 12:07 ` Kevin Darbyshire-Bryant
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/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5729C7A0.40600@darbyshire-bryant.me.uk \
--to=kevin@darbyshire-bryant.me.uk \
--cc=cake@lists.bufferbloat.net \
/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