From: quade <quade@hsnr.de>
To: Nish Aravamudan <nish.aravamudan@gmail.com>
Cc: Chris Friesen <cfriesen@nortel.com>, linux-kernel@vger.kernel.org
Subject: Re: latency error (~2ms) with nanosleep
Date: Tue, 14 Jun 2005 10:57:44 +0200 [thread overview]
Message-ID: <20050614085744.GA10668@hsnr.de> (raw)
In-Reply-To: <29495f1d05061309543a88f9bb@mail.gmail.com>
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/
prev parent reply other threads:[~2005-06-14 8:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-13 13:30 latency error (~2ms) with nanosleep quade
2005-06-13 14:21 ` Richard B. Johnson
2005-06-13 14:27 ` Eric Piel
2005-06-13 16:48 ` Chris Friesen
2005-06-13 16:54 ` Nish Aravamudan
2005-06-14 8:57 ` quade [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050614085744.GA10668@hsnr.de \
--to=quade@hsnr.de \
--cc=cfriesen@nortel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nish.aravamudan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox