All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Devera <devik@cdi.cz>
To: lartc@vger.kernel.org
Subject: [LARTC] Re: More on qdiscs - about dangling backlogs
Date: Mon, 06 May 2002 21:31:41 +0000	[thread overview]
Message-ID: <marc-lartc-102072301622287@msgid-missing> (raw)
In-Reply-To: <marc-lartc-102058802801083@msgid-missing>

>   packets at dequeue time only in clasfull qdisc. It also makes better
>   sense because qdosc can also instruct SFQ to drop packet - this drop
>
> I don't understand.  What other qdisc instructs SFQ to drop?

CBQ only at the moment. It can call q->ops->drop on inner
qdisc as response to overlimit event. It forces system to
converge faster to underlimit state

>   Another important info: you really CAN'T drop packets in dequeue
>   routine if you don't want to fool classfull parent. Many logic
>   in CBQ/HTB/ATM/PRIO qdisc is based on the existence of backlog.
>
> I gather you only care whether this qdisc is waiting to send, not how
> much is in the queue.

yes ..

>   SOLUTIONS:
>   One way is to monitor (store) q.qlen variable of all children of
>   classfull qdisc. When I call enqueue/drop/dequeue on it I'll see
>   its discrepancy agains last stored value and will update my counter
>
> This seems like the right solution, except that you shouldn't even
> need to store a counter.  Just use the one in the child qdisc.
> BTW, I think you are justified in assuming that this counter can only
> change in two ways: decrease when dequeue is called (but possibly by
> more than one packet) and increase by 1 when enqueue is called.
> And I guess also requeue.  Which raises another problem, since that's
> not called by the parent, right?

No - you can't use the q.qlen of inner. It is under inner's control
and you can't change it. And the assumption how it can change should
not be used unless you have some rules for all qdisc how to change
it.
Somewhere in sources you can read that one of qdisc duties is
to ensure that it's q.qlen value is correct. It doesn't restrict
how it can change and when.
I'd suggest for each leaf to maintain last_qlen variable which would
start with 0 (also q.qlen will be 0). Then time to time (in enqueue,
dequeue, drop ....) you can "repair" your own q.qlen by doing:
q.qlen += cl->q.qlen - cl->last_qlen; cl->last_qlen = cl->q.qlen;
for each leaf cl.
Hence xl->last_qlen tells you what part of total q.qlen is "owned" by
cl.
Simple and robust, isn't it ?

> I like those, but also suggested that HTB would be a good place to add
> code for dropping stale packets.  If you're interested in doing that I
> should mention:
> Not all packets come with timestamps (e.g., locally generated ones).
> Solution: at enqueue, if the timestamp is 0, set it to the current
> time.

It would be better done in fifo/sfq. It is because HTB can do it
only when dequeuing and at that time some packets were already dropped
by SFQ because if has had queues full of "old" packets.
SFQ should maintain pqio queue of all packets and look at head of
the list sometimes to keep its queues frre of old packets and thus
to have room for new ones.
devik

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  parent reply	other threads:[~2002-05-06 21:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-05  8:39 [LARTC] Re: More on qdiscs - about dangling backlogs Martin Devera
2002-05-06  0:23 ` Don Cohen
2002-05-06 21:31 ` Martin Devera [this message]
2002-05-06 23:48 ` Don Cohen
2002-05-07  2:11 ` Patrick McHardy
2002-05-07  5:11 ` Don Cohen
2002-05-07  7:29 ` Martin Devera
2002-05-07  7:50 ` Martin Devera
2002-05-07  7:57 ` Martin Devera
2002-05-07 18:22 ` Don Cohen
2002-05-07 18:45 ` Patrick McHardy
2002-05-07 19:20 ` Don Cohen
2002-05-09 11:53 ` Martin Devera
2002-05-09 13:46 ` Don Cohen
2002-05-09 14:43 ` 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=marc-lartc-102072301622287@msgid-missing \
    --to=devik@cdi.cz \
    --cc=lartc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.