lkml.org 
[lkml]   [2004]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: finding out the value of HZ from userspace
Jamie Lokier wrote:
> Arjan van de Ven wrote:
>
>>HZ doesn't mean nothing, esp when we go to a tickless kernel...
>
>
> As explained several times in this thread, HZ is meaningful because it
> affects the rounding in select/poll/epoll/setitimer. A few userspace
> programs with low jitter soft-RT timing requirements need to
> compensate for that rounding and/or deliberately synchronise
> themselves with the tick.
>
> Such programs can determine HZ experimentally and lock onto the tick
> in the manner of a PLL, but it would be nice to simply be able to
> have the value, to reduce the number of control variables.
>
> When we go to a tickless kernel and offer high-resolution timers to
> userspace, then it will be irrelevant. Until then, or if the kernel
> goes tickless but limits the resolution of timers for efficiency, the
> value of HZ is still relevant.

The resolution will always be limited. That's the nature of digital
systems. Unlimited resolution would require real "real" numbers and
that's not possible. The nearest you get on a digital system is the
floating point APPROXIMATION to real numbers.

>
> Not to get irritatingly back to the subject of this thread or
> anything, but... is the value of HZ reported to userspace anywhere?

I don't think so. There are those (I'm not one) who insist that to do
so would be a bug.

IMHO, as I've said several times, USER_HZ should be changed to be equal
to or greater than HZ. In fact, if having USER_HZ greater than HZ would
still make it unusable for your purposes, I'd change that opinion to say
USER_HZ should be equal to HZ (or, in other words, cease to exist).

Peter
--
Dr Peter Williams, Chief Scientist peterw@aurema.com
Aurema Pty Limited Tel:+61 2 9698 2322
PO Box 305, Strawberry Hills NSW 2012, Australia Fax:+61 2 9699 9174
79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.111 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site