[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120524064340.GA2180@netboy.at.omicron.at>
Date: Thu, 24 May 2012 08:43:40 +0200
From: Richard Cochran <richardcochran@...il.com>
To: John Stultz <john.stultz@...aro.org>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH RFC V2 3/6] time: keep track of the pending utc/tai
threshold
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists