Well, first, your issue is resolution, not precision. Current
resolution on most all timers is 1/HZ. So this should get a min.
nanosleep of 10 ms.
So, could someone explain this line from sys_nanosleep() (
kernel/timer.c):
expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
It seems to me this should just be:
expire = timespec_to_jiffies(&t)
timespec_to_jiffies(&t) seems to do all the needed resolution round up
and such. Since || is logical, this seems to always add 1, except if
the requested value is 0. The net result is you always get 1 extra
jiffie (unless you ask for zero, in which case you get a timer that will
expire next tick (thru the wonders of add_timer).
George
-
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/