From: Jarek Poplawski <jarkao2@gmail.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: Jamal Hadi Salim <hadi@cyberus.ca>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Martin Devera <martin.devera@cdi.cz>
Subject: Re: [PATCH] sch_htb: ix the deficit overflows
Date: Mon, 30 Nov 2009 11:10:20 +0000 [thread overview]
Message-ID: <20091130111020.GA7114@ff.dom.local> (raw)
In-Reply-To: <412e6f7f0911292026w704a70b8yc3af2c2473e05d34@mail.gmail.com>
On Mon, Nov 30, 2009 at 12:26:33PM +0800, Changli Gao wrote:
> On Sat, Nov 28, 2009 at 8:04 AM, Jarek Poplawski <jarkao2@gmail.com> wrote:
> > Changli Gao wrote, On 11/27/2009 09:14 AM:
> >
> >
> > This case of the quantum smaller than the packet size should be treated
> > as a broken config, so I don't think it's worth to do such a deep change
> > with additional delays and cpu cycles for all to fix it. A warning or
> > lower limit should be enough (if necessary at all).
> >
>
> I don't think this change is deep. HTB has it own lower limit for
> quantum 1000, but the MTU is various, and maybe larger than that.
Users can control this with "r2q" and "quantum", and there is a hint
on quantum size in the user's guide.
> And
> if we use IMQ to shape traffic, the skb will be defragmented by
> conntrack, and its size will be larger than MTU.
IMQ is a very nice thing, but it's considered broken as well, so it
can't be the reason for changing HTB.
>
> The previous patch indeed introduces some additional CPU cycles.
> Review the new patch bellow please:
And this patch is very similar, except ->peek()/dequeue(). Additional
lookups are done instead of dequeuing the first found class, which
might be quite long in some cases.
>
> diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
> index 2e38d1a..d55382b 100644
> --- a/net/sched/sch_htb.c
> +++ b/net/sched/sch_htb.c
> @@ -815,6 +815,17 @@ next:
> goto next;
> }
>
> + if (unlikely(cl->un.leaf.deficit[level] < 0)) {
> + cl->un.leaf.deficit[level] += cl->quantum;
> + htb_next_rb_node((level ? cl->parent->un.inner.ptr :
> + q->ptr[0]) + prio);
> + cl = htb_lookup_leaf(q->row[level] + prio, prio,
> + q->ptr[level] + prio,
> + q->last_ptr_id[level] + prio);
> + start = cl;
> + goto next;
> + }
> +
> skb = cl->un.leaf.q->dequeue(cl->un.leaf.q);
> if (likely(skb != NULL))
> break;
>
> If you think it is acceptable, I'll resubmit it for inclusion.
It's not acceptable to me mainly because the real change done by this
patch is different than you describe: preventing an overflow might be
simple. You change the way DRR is implemented here, and even if it's
right, it should be written explicitly and proved with tests results.
Anyway, I think you should rather care for the author's acceptance,
because the way it's done doesn't look like accidental and has been
heavily tested btw. (I added Martin to CC.)
Regards,
Jarek P.
PS: Btw, this newer version of the patch is broken with spaces.
next prev parent reply other threads:[~2009-11-30 11:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-27 8:14 [PATCH] sch_htb: ix the deficit overflows Changli Gao
2009-11-28 0:04 ` Jarek Poplawski
2009-11-30 4:26 ` Changli Gao
2009-11-30 11:10 ` Jarek Poplawski [this message]
2009-12-01 2:32 ` Changli Gao
2009-12-01 8:01 ` Jarek Poplawski
2009-12-01 8:43 ` Jarek Poplawski
2009-12-01 9:18 ` Changli Gao
2009-12-01 9:39 ` Jarek Poplawski
2009-12-01 19:12 ` Jarek Poplawski
2009-12-01 19:18 ` Jarek Poplawski
2009-12-02 9:20 ` David Miller
2009-12-02 10:32 ` Jarek Poplawski
2009-12-02 11:07 ` Martin Devera
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=20091130111020.GA7114@ff.dom.local \
--to=jarkao2@gmail.com \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=martin.devera@cdi.cz \
--cc=netdev@vger.kernel.org \
--cc=xiaosuo@gmail.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;
as well as URLs for NNTP newsgroup(s).