[lkml]   [2001]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Fix for sys_nanosleep() in 2.4.16
Michael Arras wrote:
> Greetings,
> For many of us, the kernel thread scheduling resolution is
> 10ms (see getitimer(2)). By adding 1 jiffy to the time to
> sleep in sys_nanosleep(), threads are sleeping 10ms too long.
> timespec_to_jiffies() does a good job at returning the
> appropriate number of jiffies to sleep. There is no need to
> add one for good measure.
Not really. It depends on where the call is made with respect to the
next jiffies interrupt. The standard says that the call MUST not return
early, thus, on the chance that the current time is not exactly on a
jiffies edge, the one must be added. The average sleep should be 1/HZ+
1/(2*HZ) or 15ms, but never less than 10ms. For higher resolution stay
tuned to the high-res-timers project (see signature line).

Real time sched:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.041 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site