mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Dmitry Antipov <dmitry.antipov@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <john.stultz@linaro.org>,
	linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org
Subject: Re: clock_getres() and real resolution
Date: Sat, 11 Feb 2012 08:39:49 +0100	[thread overview]
Message-ID: <20120211073947.GA2446@netboy.at.omicron.at> (raw)
In-Reply-To: <4F341F40.3020806@linaro.org>

On Thu, Feb 09, 2012 at 11:32:16AM -0800, Dmitry Antipov wrote:
> On 02/09/2012 10:40 AM, Richard Cochran wrote:
> 
> >I thought this list was about Linux kernel development, but now it
> >seems to be about Sun's old bugs.
> 
> This Sun (probably) has ~100000x more accurate hrtimers than it's said,
> and it's a bug. My panda board (with 32K timer enabled) has ~30000x
> less accurate hrtimers than it's said, and it's not a bug. Great.

If I understand you correctly, what you are looking for is a way to
get a promise from the OS regarding a real time deadlines, right?
But that is a different question than the timer unit resolution:

Q: What is the finest timer duration that I may request?
A: One nanosecond (answer by getres).

Q: What kind of real time deadline will my system provide?
A: Nobody knows for sure.

Just because the OS claims timer resolution X does mean that your
application can assume, "okay, I'll just set my periodic task at
duration X and the OS will take care of the rest." The only thing the
user can count on is that the timer expiration will not come _before_
the deadline. The nanosleep man page puts its like this:

   If the interval specified in req is not an exact multiple of the
   granularity underlying clock (see time(7)), then the interval will
   be rounded up to the next multiple.  Furthermore, after the sleep
   completes, there may still be a delay before the CPU becomes free
   to once again execute the calling thread.

I agree that getres does not provide very useful information. Under
Linux, it merely indicates the present of high resolution timer
support.

The practical solution to what you are asking for is overall system
testing tuning, and this is unfortunately manual labor.

Richard

  reply	other threads:[~2012-02-11  7:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 16:31 Dmitry Antipov
2012-02-09  5:12 ` Richard Cochran
2012-02-09  9:25   ` Dmitry Antipov
2012-02-09 18:40     ` Richard Cochran
2012-02-09 19:32       ` Dmitry Antipov
2012-02-11  7:39         ` Richard Cochran [this message]
2012-02-09 10:12 ` Thomas Gleixner
2012-02-09 15:26   ` Dmitry Antipov

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=20120211073947.GA2446@netboy.at.omicron.at \
    --to=richardcochran@gmail.com \
    --cc=dmitry.antipov@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.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®