RE: 2.6.11 timeval_to_jiffies() wrong for ms resolution timers

From: Davda, Bhavesh P (Bhavesh)
Date: Wed May 25 2005 - 14:11:51 EST


> -----Original Message-----
> From: Chris Friesen [mailto:cfriesen@xxxxxxxxxx]
> Sent: Wednesday, May 25, 2005 12:08 PM
> To: george@xxxxxxxxxx
> Cc: Davda, Bhavesh P (Bhavesh); linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: 2.6.11 timeval_to_jiffies() wrong for ms
> resolution timers
>
> George Anzinger wrote:
> > Chris Friesen wrote:
>
> >> What about telling it to wake up a jiffy earlier, then checking
> >> whether the scheduling lag was enough to cause it to have
> waited the
> >> full specified time. If not, put it to sleep for another jiffy.
>
> > The user is, of course, free to do what ever they would like.
>
> I actually meant doing this in the kernel.

Ditto.

>
> > For a
> > more complete solution you might be interested in HRT (High Res
> > Timers). See my signature below.
>
> Yep. One more patch to apply and worry about versions and
> maintenance.
> Not enough of a demand for us to be able to use it, at
> least at this
> point.
>
> Chris

Ditto ditto :)

BTW, this reminds me an aweful lot of TH2GT2G, and Deep Thought taking 7.5 million years to come up with the answer "42!"

Me: Hey Deep Thought! What's 20 us converted into jiffies?

Deep Thought: Let's see: after accounting for all kinds of underflow and overflow possibilities, and extending the operands to 64-bit to retain the best precision, and crunching through a few complex macros, the answer you're looking for is... Is... Is... "21!" The real problem is: You didn't ask me the right question. You should have asked me "What's 19 us converted into jiffies?"

On a more serious note: what is a real-time (read SCHED_FIFO/SCHED_RR) task to use to get millisecond accuracy wakeup timing services from the kernel? i.e. what are the alternatives to setitimer() that wake up the task exactly at the interval that is requested of it? You mention high-res timers as a possibility, but in the form of a patch. What's available in mainline unpatched?

Thanks

- Bhavesh



Bhavesh P. Davda | Distinguished Member of Technical Staff | Avaya |
1300 West 120th Avenue | B3-B03 | Westminster, CO 80234, U.S.A. |
Voice/Fax: (303) 538-4438 | bhavesh@xxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/