lkml.org 
[lkml]   [2005]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: latency error (~2ms) with nanosleep
On Mon, Jun 13, 2005 at 09:54:47AM -0700, Nish Aravamudan wrote:
> On 6/13/05, Chris Friesen <cfriesen@nortel.com> wrote:
> > quade wrote:
> > > Playing around with the (simple) measurement of latency-times
> > > I noticed, that the systemcall "nanosleep" has always a minimal
> > > latency from about ~2ms (haven't run it all night, so...). It
> > > seems to be a systematical error.
> >
> > Known issue. The x86 interrupt usually has a period of slightly less
> > than a ms. It will therefore generally add nearly a whole ms to ensure
> > that it does not ever wait for *less* than specified.
>
> Exactly. And the sys_nanosleep() code adds one more if the parameter
> has any positive value at all:
>
> expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);


> current->state = TASK_INTERRUPTIBLE;
> expire = schedule_timeout(expire);
>
> Thanks,
> Nish
> -
> 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/
-
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/

\
 
 \ /
  Last update: 2005-06-14 11:01    [W:0.030 / U:1.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site