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: Tue, 1 Dec 2009 08:43:32 +0000 [thread overview]
Message-ID: <20091201084332.GB6408@ff.dom.local> (raw)
In-Reply-To: <20091201080151.GA6408@ff.dom.local>
On Tue, Dec 01, 2009 at 08:01:51AM +0000, Jarek Poplawski wrote:
> On Tue, Dec 01, 2009 at 10:32:26AM +0800, Changli Gao wrote:
> > On Mon, Nov 30, 2009 at 7:10 PM, Jarek Poplawski <jarkao2@gmail.com> wrote:
...
> > > 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.
> >
> > If the quantum is set correctly, there isn't difference except of a
> > comparison. In the other case, I think some additional CPU cycles are
> > better than overflow.
>
> No, my main point is there _is_ a difference when the quantum is set
> correctly. Just these additional lookups.
And, again, there are less invasive ways to fix such overflow, like
htb_dequeue_tree()
{
...
if (likely(skb != NULL)) {
cl->un.leaf.deficit[level] -= qdisc_pkt_len(skb);
if (cl->un.leaf.deficit[level] < 0) {
cl->un.leaf.deficit[level] += cl->quantum;
+ if (cl->un.leaf.deficit[level] < 0)
+ cl->un.leaf.deficit[level] = -cl->quantum;
+ /* or other limit */
htb_next_rb_node((level ? cl->parent->un.inner.ptr : q->
ptr[0]) + prio);
}
/* this used to be after charge_class but this constelation
gives us slightly better performance */
if (!cl->un.leaf.q->q.qlen)
htb_deactivate(q, cl);
htb_charge_class(q, cl, level, skb);
}
return skb;
}
or even always zeroing cl->un.leaf.deficit[level] on activation or
deactivation (it's seems unlikely one activity period is enough for
such an overflow).
Jarek P.
next prev parent reply other threads:[~2009-12-01 8:43 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
2009-12-01 2:32 ` Changli Gao
2009-12-01 8:01 ` Jarek Poplawski
2009-12-01 8:43 ` Jarek Poplawski [this message]
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=20091201084332.GB6408@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).