From: "Richard B. Johnson" <linux-os@analogic.com>
To: quade <quade@hsnr.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: latency error (~2ms) with nanosleep
Date: Mon, 13 Jun 2005 10:21:00 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.61.0506131011370.16830@chaos.analogic.com> (raw)
In-Reply-To: <20050613133047.GA11979@hsnr.de>
nanosleep, according to the documation is supposed to sleep
"at least" the 'struct timespec' time. It can return in
a shorter time as a result of a signal and, if so, the
input time-values will be updated accordingly. The resolution
is limited to the HZ value. This means that it will, unless
interrupted, always sleep at least 1 / HZ seconds (about 1 ms
on current x86 distributions).
FYI, there is no 'fine resolution' timer available on any
Linux-ported platform that could take advantage of the nanosecond
input resolution of the function.
On Mon, 13 Jun 2005, 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.
>
> A short investigation shows, that "sys_nanosleep()" uses
> schedule_timeout(), but schedule_timeout() is working exactly
> as expected. Therefore I think it has something to do with
> the scheduling?
>
> Has someone an explanation for the ~2ms error?
> If it is indeed a systematical error, does it make sense to
> "adjust" (correct) this error in the systemcall "sys_nanosleep()"?
>
> Find attached my small test program.
>
> Juergen.
>
Cheers,
Dick Johnson
Penguin : Linux version 2.6.11.9 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.
next prev parent reply other threads:[~2005-06-13 14:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-13 13:30 quade
2005-06-13 14:21 ` Richard B. Johnson [this message]
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
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=Pine.LNX.4.61.0506131011370.16830@chaos.analogic.com \
--to=linux-os@analogic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=quade@hsnr.de \
/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
all inboxes | Powered by JetHome®