* [LARTC] userlevel should not need to know about HZ?
@ 2006-02-23 20:21 Andreas Hasenack
2006-02-23 22:47 ` Andreas Klauer
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andreas Hasenack @ 2006-02-23 20:21 UTC (permalink / raw)
To: lartc
Kernel people tell me users should never need to know the value of HZ
used by the currently running kernel. One kernel hacker even told me
that Linus once changed the value from 100 to 1000 just to see user
space programs break.
However, it is needed for the buffer parameter in TBF. The tc-tbf(8)
manpage:
If your buffer is too small, packets may be dropped because more
tokens arrive per timer tick than fit in your bucket. The mini-
mum buffer size can be calculated by dividing the rate by HZ.
My kernel (2.6.12), for example, doesn't have a CONFIG option in
/proc/config.gz. I only found out the correct HZ value by looking into
/usr/include/asm/param.h, and even there are two values: 1000 for
__KERNEL__ and 250 for the rest. Newer kernels have CONFIG options and
1000 is just one of the possible values.
So, how do we reliably calculate the minimum value for buffer/burst/maxburts?
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [LARTC] userlevel should not need to know about HZ?
2006-02-23 20:21 [LARTC] userlevel should not need to know about HZ? Andreas Hasenack
@ 2006-02-23 22:47 ` Andreas Klauer
2006-02-23 23:45 ` Andreas Hasenack
2006-02-25 11:53 ` Andy Furniss
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Klauer @ 2006-02-23 22:47 UTC (permalink / raw)
To: lartc
On Thu, Feb 23, 2006 at 05:21:46PM -0300, Andreas Hasenack wrote:
> Kernel people tell me users should never need to know the value of HZ
> used by the currently running kernel. One kernel hacker even told me
> that Linus once changed the value from 100 to 1000 just to see user
> space programs break.
Hmmm. Don't know the context of this statement, but from my (naive)
point of view, TBF is not a user space program. The user space program
is tc, and it just sets up structures in the kernel once. The shaping
itself is done in kernel space.
> So, how do we reliably calculate the minimum value for buffer/burst/maxburts?
Trial & Error, not that I ever had much luck with TBF though...
TBF doesn't really depend on the HZ value - you don't really need to know.
Still, TBF is affected by the HZ, like many other parts of the kernel too.
It can't be helped - dunno what else to say about it.
Regards
Andreas Klauer
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LARTC] userlevel should not need to know about HZ?
2006-02-23 20:21 [LARTC] userlevel should not need to know about HZ? Andreas Hasenack
2006-02-23 22:47 ` Andreas Klauer
@ 2006-02-23 23:45 ` Andreas Hasenack
2006-02-25 11:53 ` Andy Furniss
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Hasenack @ 2006-02-23 23:45 UTC (permalink / raw)
To: lartc
Em Qui 23 Fev 2006 19:47, Andreas Klauer escreveu:
> > So, how do we reliably calculate the minimum value for
> > buffer/burst/maxburts?
>
> Trial & Error, not that I ever had much luck with TBF though...
From my experiments, the minimum seems to be either MTU plus a few bytes or
the result of rate/HZ, whichever is higher.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LARTC] userlevel should not need to know about HZ?
2006-02-23 20:21 [LARTC] userlevel should not need to know about HZ? Andreas Hasenack
2006-02-23 22:47 ` Andreas Klauer
2006-02-23 23:45 ` Andreas Hasenack
@ 2006-02-25 11:53 ` Andy Furniss
2 siblings, 0 replies; 4+ messages in thread
From: Andy Furniss @ 2006-02-25 11:53 UTC (permalink / raw)
To: lartc
Andreas Hasenack wrote:
> Em Qui 23 Fev 2006 19:47, Andreas Klauer escreveu:
>
>>>So, how do we reliably calculate the minimum value for
>>>buffer/burst/maxburts?
>>
>>Trial & Error, not that I ever had much luck with TBF though...
>
>
> From my experiments, the minimum seems to be either MTU plus a few bytes or
> the result of rate/HZ, whichever is higher.
Both the buffers need to be at least MTU and if you shape on eth MTU+14.
You should set the limit buffer to the length of queue you want -
1*MTU(+14) is pretty useless for a limit but OK for burst.
I am not sure about tbf and Hz if it's like htb you need to set burst
big enough so its size * HZ can fill the link.
Andy.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-02-25 11:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-23 20:21 [LARTC] userlevel should not need to know about HZ? Andreas Hasenack
2006-02-23 22:47 ` Andreas Klauer
2006-02-23 23:45 ` Andreas Hasenack
2006-02-25 11:53 ` Andy Furniss
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.