Re: 2.6.11 timeval_to_jiffies() wrong for ms resolution timers

From: George Anzinger
Date: Wed May 25 2005 - 15:03:58 EST


~
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?

We ARE trying to get this into the main line, but save the patch, there is no way to get millisecond accuracy in the kernel OR in user land. Never has been! That is why the patch exists. There was an effort by some university folks prior to the HRT stuff, but AFAIK it is not supported or uptodate.

Also, you should be aware that even with precise timers, there is still latency in the kernel AND it is in the millisecond range. Again, folks are working on that in the form of a patch (see the the real time patch by Ingo and friends).

As for jiffies vs time, my understanding from senior time folks is that 1/HZ as a resolution is just an approximation. We do the best we can but the x86 is really the PITs (pun intended) when it comes to time keeping resources. If you really want millisecond accuracy, you may need to consider another platform....

--
George Anzinger george@xxxxxxxxxx
HRT (High-res-timers): http://sourceforge.net/projects/high-res-timers/
-
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/