From: Richard Cochran <richardcochran@gmail.com>
To: John Stultz <john.stultz@linaro.org>
Cc: linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH RFC V2 3/6] time: keep track of the pending utc/tai threshold
Date: Thu, 24 May 2012 08:43:40 +0200 [thread overview]
Message-ID: <20120524064340.GA2180@netboy.at.omicron.at> (raw)
In-Reply-To: <4FBD4613.7040003@linaro.org>
On Wed, May 23, 2012 at 01:18:27PM -0700, John Stultz wrote:
> So I've avoided the term epoch just to try not to confuse things
> with the unix epoch, that's why I've used next_leap, etc.
> Even so, I'm not sure you've made clear the subtlety of the difference.
For me, when working with the whole UTC leap second mess, it is
important to distinguish between the leap seconds and the epochs. I
sometime have written mini-epoch to make clear that it is not about
*the* epoch from 1970.
The NIST leap second table give a list of epochs and TAI offsets. The
leap second is always the second just before the epoch. For example:
30 June 1972 23:59:59 (NTP 2287785599, first time) <-- normal second
30 June 1972 23:59:60 (NTP 2287785599, second time) <-- leap second
1 July 1972 00:00:00 (NTP 2287785600) <-- epoch
We should write the thresholding code so that it is clear whether we
are testing against the epoch or the leap second.
> I believe the internal time_state (along with the next leap second)
> already provides this.
>
> From the reader's perspective:
>
> Not applied: (INS&& U< leap): return (INS, U)
> Applied: (INS&& U == leap): return (OOP, U-1)
> Finished applied: ((INS||OOP)&& U>= (leap+1)): return (WAIT,U-1)
> Delete: (DEL&& U>= (leap-1)): return (WAIT,U+1)
I think this is still wrong, but I get your point.
My patch makes the state of the leap second application explicit and
then infers time_state on demand. You can also, of course, make
time_state explicit and infer whether or not the leap second has been
applied.
My point is that in either case, it is the same amount of code.
I prefer what I wrote, because I think it is clearer.
> Again, no state change is done by the reader, so we don't have to
> keep track of application state or not.
> Then when the tick comes in, it will move the state machine appropriately.
>
> Sorry working this out is so difficult. If we don't come to
> consensus soon, I'll try to find some time to implement what I'm
> suggesting so you aren't up against my unclear hand-waving. :)
BTW you can use the program I have been using to test this at
git://github.com/richardcochran/leap.git
Thanks,
Richard
next prev parent reply other threads:[~2012-05-24 6:43 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-18 14:09 [PATCH RFC V2 0/6] Fix leap seconds and add tai clock Richard Cochran
2012-05-18 14:09 ` [PATCH RFC V2 1/6] time: remove obsolete declaration Richard Cochran
2012-05-21 23:57 ` John Stultz
2012-05-18 14:09 ` [PATCH RFC V2 2/6] ntp: remove useless parameter Richard Cochran
2012-05-21 23:58 ` John Stultz
2012-05-18 14:09 ` [PATCH RFC V2 3/6] time: keep track of the pending utc/tai threshold Richard Cochran
2012-05-21 18:09 ` John Stultz
2012-05-21 19:08 ` Richard Cochran
2012-05-22 17:39 ` Richard Cochran
2012-05-22 18:06 ` John Stultz
2012-05-23 8:29 ` Richard Cochran
2012-05-23 16:50 ` John Stultz
2012-05-23 19:17 ` Richard Cochran
2012-05-23 20:18 ` John Stultz
2012-05-24 6:43 ` Richard Cochran [this message]
2012-05-24 6:57 ` Richard Cochran
2012-05-26 15:07 ` Richard Cochran
2012-05-30 1:46 ` John Stultz
2012-05-30 1:49 ` John Stultz
2012-05-30 5:11 ` Richard Cochran
2012-05-30 5:56 ` John Stultz
2012-05-30 6:19 ` Richard Cochran
2012-05-30 6:23 ` John Stultz
2012-05-30 7:27 ` Richard Cochran
2012-05-23 19:42 ` Richard Cochran
2012-05-21 18:21 ` John Stultz
2012-05-21 19:13 ` Richard Cochran
2012-05-18 14:09 ` [PATCH RFC V2 4/6] time: introduce leap second functional interface Richard Cochran
2012-05-21 18:01 ` John Stultz
2012-05-21 19:18 ` Richard Cochran
2012-05-21 20:24 ` John Stultz
2012-05-22 4:25 ` Richard Cochran
2012-05-22 15:10 ` John Stultz
2012-05-18 14:09 ` [PATCH RFC V2 5/6] time: move leap second management into time keeping core Richard Cochran
2012-05-21 18:18 ` John Stultz
2012-05-21 19:24 ` Richard Cochran
2012-05-18 14:09 ` [PATCH RFC V2 6/6] time: Add CLOCK_TAI clockid Richard Cochran
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=20120524064340.GA2180@netboy.at.omicron.at \
--to=richardcochran@gmail.com \
--cc=john.stultz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.