netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Devera <devik@cdi.cz>
To: Patrick McHardy <kaber@trash.net>
Cc: Badalian Vyacheslav <slavon@bigtelecom.ru>, netdev@vger.kernel.org
Subject: Re: Not understand some in htb_do_events function
Date: Tue, 15 Jan 2008 12:59:38 +0100	[thread overview]
Message-ID: <478CA02A.1070308@cdi.cz> (raw)
In-Reply-To: <478C87D9.1010305@trash.net>

Patrick McHardy wrote:
> Badalian Vyacheslav wrote:
>> Hello all.
>> I have many messages like "htb: too many events !" in dmesg.
>>
>> Try to see code and find that function try do 500 events at call.
>> Hm... may anyone ask why 500? Why its not dynamic value based on 
>> performance of PC?
> 
> 
> Thats a good question, I wonder why it is limited at all.
> Martin, any hints?
> 
> 

Hi, I recently replied someone to the same question:

 > it is possible when during one jiffie (1 or 10ms) more than 500 classes
 > changed its state. It is meant to protect your system from livelock.
 > The constant should be set to something like
 > bogomips/bogocomplexity_of_state_change but it was not done.

the solution I have in my mind is to change
    if (net_ratelimit())
                  printk(KERN_WARNING "htb: too many events !\n");
          return HZ/10;
  to
    return 1;

to drain extra events asap. It the time of writing I was not able to
come with better solution and there were more bugs related to this
part of code than now.
We want way to smooth big burst of events over more dequeue invocations
in order to not slow dequeue too much. Constant 500 is max. allowed
"slowdown" of dequeue.
Any bright idea how to do it more elegant, Patrick ?

brgds, devik

  reply	other threads:[~2008-01-15 12:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 10:11 Not understand some in htb_do_events function Badalian Vyacheslav
2008-01-15 10:15 ` Patrick McHardy
2008-01-15 11:59   ` Martin Devera [this message]
2008-01-15 13:51     ` Badalian Vyacheslav
2008-01-15 13:54       ` Martin Devera
2008-01-15 15:54     ` Patrick McHardy
2008-01-15 21:58       ` Martin Devera
2008-01-16  5:15         ` Patrick McHardy
2008-01-16  5:07       ` 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=478CA02A.1070308@cdi.cz \
    --to=devik@cdi.cz \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=slavon@bigtelecom.ru \
    /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).