lkml.org 
[lkml]   [2005]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: HZ question
From
Date
On Tue, 2005-09-13 at 11:05 -0400, Mark Hounschell wrote:
> Tim Schmielau wrote:
> > On Tue, 13 Sep 2005, Mark Hounschell wrote:
> >
> >>Most if not all userland delay calls rely on HZ value in some way or
> >>another. The minimum reliable delay you can get is one (kernel)HZ. A
> >>program that needs an acurrate delay for a time shorter that one
> >>(kernel)HZ may have an alternative if it knows that HZ is greater the
> >>the requested delay.
> >
> > Just assume that kernel HZ are USER_HZ and see anything else as an
> > additional bonus that you cannot rely on.
> >
> > What does 'acurrate delay' mean, anyways?
> >
> > Tim
> >
>
> But they are not the same. Why can I get USER_HZ but not HZ?

Because USER_HZ is there only because HZ changes on various systems and
we don't want to break userland apps that assume its value.


> On a 100HZ kernel ANY requested delay via udelay or
> pthread_cond_timedwait of less than 10000usecs is unreliable and the the
> actual results are totally unacceptable.
>
> On a 1000HZ kernel the number is 1000 usecs.
>
> I'm not asking the kernel running at 1000hz to actually give me 500 usec
> delay if I ask. I do expect it to be at least 500 usec and within +- a
> single HZ however. Oviously a 1000HZ machine is going to give me better
> resulution in any requested delay. Why is it unreasonable for userland
> to know the probable resolution of userland delay requests.

But you don't really want to know HZ, you want to know timer resolution.
That's a reasonable request and I believe the posix-timers
clock_getres() interface might provide what you need. Although I'd defer
to George (CC'ed) since he's more of an expert on those interfaces.

You might also want to check out his HRT patches.

thanks
-john


-
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-09-13 19:37    [W:0.112 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site