From: Sebastian Moeller <moeller0@gmx.de>
To: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
Cc: cake@lists.bufferbloat.net
Subject: Re: [Cake] cake review comments cake_drop
Date: Sun, 4 Oct 2015 12:50:34 +0200 [thread overview]
Message-ID: <01DFDB5B-04E1-4DF9-B540-FE090111E3A6@gmx.de> (raw)
In-Reply-To: <56102F88.8070201@darbyshire-bryant.me.uk>
Hi Kevin,
On Oct 3, 2015, at 21:42 , Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk> wrote:
> Hello All,
>
> On 18th Aug (before I'd subscribed to the list), Dave posted a message
> about reviewing cake
> https://lists.bufferbloat.net/pipermail/cake/2015-August/000364.html
>
> In it he mentioned a change to cake_drop:
>
> "
>
> I would like cake_drop to be evaluated with some less exaustive
> search. It also looks wrong
>
> for(j=0; j < CAKE_MAX_CLASSES; j++) {
> fqcd = &q->classes[j];
>
> CAKE_MAX_CLASSES should actually be q->class_cnt here; I think. I am
> unsure if other references to it are correct in face of changes, on
> cleanup"
>
>
> After making the change and nearly submitting a pull request I've
> thought about this some more and to be blunt it makes me nervous. My
> concern is what happens if cake is changed from say a diffserv8 config
> to a single class(bin) config and for whatever reason 'cake_drop' is
> called. with diffserv8 the fat flow is likely to be in a class(bin)
> higher than the first....cake_drop would now only check the first class
> for the fat flow and possibly not find anything to drop.... I fear what
> happens next!
I thought the following takes care of that (called from cake_reconfigure() ):
/* Discard leftover packets from a class no longer in use. */
static void cake_clear_class(struct Qdisc *sch, u16 class)
{
struct cake_sched_data *q = qdisc_priv(sch);
struct cake_fqcd_sched_data *fqcd = &q->classes[class];
q->cur_class = class;
for(q->cur_flow = 0; q->cur_flow < fqcd->flows_cnt; q->cur_flow++)
while(custom_dequeue(NULL, sch))
;
}
I probably do no understand things fully enough, but to me this seems to take care of your concern. Especially since cake_reconfigure will only touch classes from q->class_cnt up to CAKE_MAX_CLASSES. Since I am not very fluent in C I might have missed things… That means that exchanging CAKE_MAX_CLASSES with q->class_cnt in cake_drop() should be safe. The question left is then how costly is it to search empty classes? I guess, cake_drop is the slow path and hence could afford to search them all, then again cake_drop probably tests called most under heavy traffic conditions, so even the slow path performance might be noticeable to the user…
Best Regards
Sebastian
>
> Kevin
>
> _______________________________________________
> Cake mailing list
> Cake@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cake
next prev parent reply other threads:[~2015-10-04 10:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-03 19:42 Kevin Darbyshire-Bryant
2015-10-04 9:03 ` Jonathan Morton
2015-10-04 10:56 ` Sebastian Moeller
2015-10-04 17:46 ` Kevin Darbyshire-Bryant
2015-10-05 7:27 ` Sebastian Moeller
2015-10-04 10:50 ` Sebastian Moeller [this message]
2015-10-04 17:23 ` 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=01DFDB5B-04E1-4DF9-B540-FE090111E3A6@gmx.de \
--to=moeller0@gmx.de \
--cc=cake@lists.bufferbloat.net \
--cc=kevin@darbyshire-bryant.me.uk \
/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