netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@o2.pl>
To: Patrick McHardy <kaber@trash.net>
Cc: devik@cdi.cz, netdev@vger.kernel.org
Subject: Re: [NET_SCHED 06/06]: Fix endless loops (part 4): HTB
Date: Thu, 23 Nov 2006 09:39:09 +0100	[thread overview]
Message-ID: <20061123083909.GA1586@ff.dom.local> (raw)
In-Reply-To: <20061120130848.22347.85130.sendpatchset@localhost.localdomain>

On 20-11-2006 14:08, Patrick McHardy wrote:
> [NET_SCHED]: Fix endless loops (part 4): HTB
> 
> Convert HTB to use qdisc_tree_decrease_len() and add a callback
> for deactivating a class when its child queue becomes empty.
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>
> 
> ---
... 
> diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
> index 3b36e9d..215e68c 100644
> --- a/net/sched/sch_htb.c
> +++ b/net/sched/sch_htb.c
> @@ -1230,11 +1230,7 @@ static int htb_graft(struct Qdisc *sch, 
>  			return -ENOBUFS;
>  		sch_tree_lock(sch);
>  		if ((*old = xchg(&cl->un.leaf.q, new)) != NULL) {
> -			if (cl->prio_activity)
> -				htb_deactivate(qdisc_priv(sch), cl);
> -
> -			/* TODO: is it correct ? Why CBQ doesn't do it ? */
> -			sch->q.qlen -= (*old)->q.qlen;
> +			qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
>  			qdisc_reset(*old);
>  		}
>  		sch_tree_unlock(sch);
> @@ -1249,6 +1245,14 @@ static struct Qdisc *htb_leaf(struct Qdi
>  	return (cl && !cl->level) ? cl->un.leaf.q : NULL;
>  }
>  
> +static void htb_qlen_notify(struct Qdisc *sch, unsigned long arg)
> +{
> +	struct htb_class *cl = (struct htb_class *)arg;
> +
> +	if (cl->un.leaf.q->q.qlen == 0)

Probably "if (cl->prio_activity)" is needed here.

> +		htb_deactivate(qdisc_priv(sch), cl);
> +}
> +

Regards,

Jarek P.

PS: from 00/06:
> PS: If anyone wants to suggest a nicer name for qdisc_tree_decrease_qlen
> I'll gladly send new patches :)

Increasing is nicer so maybe: qdisc_tree_increase_qlen?


  parent reply	other threads:[~2006-11-23  8:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20 13:08 [NET_SCHED 00/06]: Fix endless dequeue loops Patrick McHardy
2006-11-20 13:08 ` [NET_SCHED 01/06]: sch_htb: perform qlen adjustment immediately in ->delete Patrick McHardy
2006-11-30  1:35   ` David Miller
2006-11-20 13:08 ` [NET_SCHED 02/06]: Set parent classid in default qdiscs Patrick McHardy
2006-11-30  1:35   ` David Miller
2006-11-20 13:08 ` [NET_SCHED 03/06]: Fix endless loops caused by inaccurate qlen counters (part 1) Patrick McHardy
2006-11-20 14:23   ` Mika Penttilä
2006-11-20 14:31     ` Patrick McHardy
2006-11-20 14:44       ` Mika Penttilä
2006-11-20 14:51         ` Patrick McHardy
2006-11-20 16:07           ` Mika Penttilä
2006-11-20 16:42             ` Patrick McHardy
2006-11-30  1:35   ` David Miller
2006-11-20 13:08 ` [NET_SCHED 04/06]: Fix endless loops (part 2): "simple" qdiscs Patrick McHardy
2006-11-24 12:33   ` Jarek Poplawski
2006-11-24 13:07     ` Patrick McHardy
2006-11-24 13:37       ` Jarek Poplawski
2006-11-27  6:46       ` Jarek Poplawski
2006-11-30  1:36   ` David Miller
2006-11-20 13:08 ` [NET_SCHED 05/06]: Fix endless loops (part 3): HFSC Patrick McHardy
2006-11-30  1:36   ` David Miller
2006-11-20 13:08 ` [NET_SCHED 06/06]: Fix endless loops (part 4): HTB Patrick McHardy
2006-11-20 13:39   ` Martin Devera
2006-11-23  8:39   ` Jarek Poplawski [this message]
2006-11-23  8:44     ` Patrick McHardy
2006-11-23  9:01       ` Jarek Poplawski
2006-11-23  9:07         ` Patrick McHardy
2006-11-23  9:32           ` Martin Devera
2006-11-23  9:48             ` Patrick McHardy
2006-11-23 10:59             ` Jarek Poplawski
2006-11-30  1:37   ` 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=20061123083909.GA1586@ff.dom.local \
    --to=jarkao2@o2.pl \
    --cc=devik@cdi.cz \
    --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;
as well as URLs for NNTP newsgroup(s).