public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Arun Sharma <asharma@fb.com>, LKML <linux-kernel@vger.kernel.org>,
	Kumar Sundararajan <kumar@fb.com>
Subject: Re: clock_gettime_ns
Date: Wed, 04 Sep 2013 13:54:53 -0700	[thread overview]
Message-ID: <52279E1D.3060907@linaro.org> (raw)
In-Reply-To: <CALCETrVc-3j=7bP13dkYwqxUg77rdauHQ8_KEti0khh-HX220A@mail.gmail.com>

On 09/04/2013 01:33 PM, Andy Lutomirski wrote:
> On Wed, Sep 4, 2013 at 12:20 PM, John Stultz <john.stultz@linaro.org> wrote:
>> On Wed, Sep 4, 2013 at 11:51 AM, Andy Lutomirski <luto@amacapital.net> wrote:
>>> I think that most of the hangup was a lack of agreement on how the API
>>> should work wrt leap seconds.
>> I don't recall this objection. The interface uses existing clockids,
>> so it probably should keep the existing leap-second behavior of those
>> clockids.
>>
>>> I've always thought that the Right Way to represent a UTC time is
>>> nanoseconds since some epoch, where every potential leap second
>>> counts.
>> Check out the CLOCK_TAI clockid merged in 3.10.
>>
> I never really liked that -- CLOCK_TAI doesn't tell what time it is in
> any format that normal people understand.
>
> I'd advocate for going whole hog and returning, atomically:
>
>  - TAI (nanoseconds from epoch)
>  - UTC - TAI (seconds or nanoseconds) *
>  - TAI - CLOCK_MONOTONIC (nanoseconds)
>  - a leap second flag.
>
> * There are various ways to define this.  My fancy UTC - TAI wouldn't
> actually need the leap-second flag, since the UTC time would indicate
> leap seconds directly.  With the conventional approach, someone would
> have to decide whether the leap second count increments at the
> beginning or the end of the leap second.

Well, adjtimex() gives you UTC & tai offset & leapsecond flag in one go.

thanks
-john


  reply	other threads:[~2013-09-04 20:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04  9:18 clock_gettime_ns Arun Sharma
2013-09-04 18:51 ` clock_gettime_ns Andy Lutomirski
2013-09-04 19:20   ` clock_gettime_ns John Stultz
2013-09-04 20:33     ` clock_gettime_ns Andy Lutomirski
2013-09-04 20:54       ` John Stultz [this message]
2013-09-04 22:29         ` clock_gettime_ns H. Peter Anvin
2013-09-04 22:59           ` clock_gettime_ns John Stultz
2013-09-04 23:04             ` clock_gettime_ns H. Peter Anvin
2013-09-04 23:20               ` clock_gettime_ns John Stultz
2013-09-04 23:38           ` clock_gettime_ns Andy Lutomirski
2013-09-05  1:22             ` clock_gettime_ns H. Peter Anvin
2013-09-09 17:47               ` clock_gettime_ns Andy Lutomirski
2013-09-11 18:50                 ` clock_gettime_ns Richard Cochran
2013-09-04 19:17 ` clock_gettime_ns John Stultz
2013-09-04 20:23   ` clock_gettime_ns Andy Lutomirski
2013-09-04 20:50     ` clock_gettime_ns John Stultz
2013-09-05  4:45   ` clock_gettime_ns Arun Sharma

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=52279E1D.3060907@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=asharma@fb.com \
    --cc=kumar@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /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