Re: itimer again (Re: [PATCH] RTC: Add mmap method to rtc character driver)

Bill Huey
2006-07-30T00:24:44Z

On Sun, Jul 30, 2006 at 02:16:59AM +0200, Edgar Toernig wrote:
> Bill Huey (hui) wrote:
> > It's a different topic than what Keith needs,
>
> Hmm, actually, people with problems like Keith's are the target
> audience, or at least were meant to be. See the mmap example
> I posted in the original thread.
>
> > but this is useful for another set of purposes. It's something that's
> > really useful in the RT patch since there isn't a decent API to get at
> > high resolution timers in userspace.
>
> The /dev/itimer wasn't meant for high resolution, only accurate and
> reliable within the limits of the jiffy counter and easy to use. That
> doesn't mean that it can't be improved to provide high resolution; only,
> that this wasn't the design goal. But I think, that the API is good
> enough to provide high resolution at any time without changing user
> space code.
>
> (IMHO most people consider a resolution of 1 ms to be "high enough".)

Have you thought about making it an 'rtc' replacement and getting it to
conform to the API of it to what ever degree makes sense ? then it would
be a general replacement for 'rtc' if it could be opened multipule times
(as with generic event interfaces) with different timing scenarios per
thread.

> Hm... I'm not sure what you mean. Sure, a blocking read may be a nice hint
> to the scheduler because we know exactly how long we're gonna sleep. But
> I think that a blocking read is used very seldom. Normally, the apps would
> block via select/poll. And then the hints become looser - you only know
> the latest time when the process definitely wants to run again.
>
> Another scheduling hint could be the set interval. One could assume that
> an app that sets an interval of 1/50th second does want to run regularly
> every 1/50th second. But that may be hard to use for scheduling decisions,
> especially when an app starts to use more than one timer.

Don't worry about what I just said, really. The fact that this driver exists
make it possible for heavy modification of just about any sort.

bill