mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Dmitry Antipov <dmitry.antipov@linaro.org>
Cc: John Stultz <john.stultz@linaro.org>,
	linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org
Subject: Re: clock_getres() and real resolution
Date: Thu, 9 Feb 2012 11:12:48 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.02.1202091051310.2794@ionos> (raw)
In-Reply-To: <4F32A347.4090703@linaro.org>

On Wed, 8 Feb 2012, Dmitry Antipov wrote:

> IIUC, an idea behind clock_getres() is to give a hint about the resolution of
> specified clock. This hint may be used by an application programmer to check
> whether
> this clock is suitable for a some purpose. So why clock_getres() always
> returns
> something like {0, 1} (if hrtimers are enabled) regardless of the underlying
> platform's
> real numbers?
> 
> For example, OMAP4's real resolution of CLOCK_REALTIME is 30.5us for 32K timer
> and 26ns
> for MPU timer. Such a difference definitely makes sense - but
> clock_getres(CLOCK_REALTIME,..)
> always returns {0, KTIME_HIGH_RES}. Since this behavior causes a confusion
> like
> http://lists.linaro.org/pipermail/linaro-dev/2012-February/010112.html, I'm
> considering
> this as a stupid misfeature.

We had this discussion before. The point is that the accuracy of the
internal kernel timer handling is 1nsec in case of high resolution
timers. The fact that the underlying clock event device has a coarser
resolution does not change that. 

It would be possible to return the real resolution of the clock event
device, but we have systems, where the clockevent device is
dynamically changing. So which resolution do we expose to an
application? The one of the current active device or some magic number
of a device which might not even be initialized? That's more confusing
than telling user space that high resolution timers are active and the
kernel is trying to achieve the 1ns accuracy.

Thanks,

	tglx

  parent reply	other threads:[~2012-02-09 10:12 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
2012-02-09 10:12 ` Thomas Gleixner [this message]
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=alpine.LFD.2.02.1202091051310.2794@ionos \
    --to=tglx@linutronix.de \
    --cc=dmitry.antipov@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome