[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ntp-hackers
Subject:    Re: [ntp:hackers] ITU and Leap second elimination
From:       Miroslav Lichvar <mlichvar () redhat ! com>
Date:       2013-10-08 9:39:49
Message-ID: 20131008093949.GP24690 () localhost
[Download RAW message or body]

On Fri, Oct 04, 2013 at 06:51:25PM +0200, juergen perlinger wrote:
> On 10/04/2013 10:03 AM, Miroslav Lichvar wrote:
> > I think the CLOCK_MONOTONIC users care only about frequency accuracy
> > and the CLOCK_REALTIME users care mostly about time accuracy. If the
> > two clocks were decoupled, wouldn't it be easier to apply the leap
> > second to CLOCK_REALTIME by slewing without disturbing CLOCK_MONOTONIC?
> > It would possibly allow also other nice thing, like improving the
> > frequency accuracy of CLOCK_MONOTONIC by not including the PLL phase
> > adjustments to it.
> >
> Linux has CLOCK_MONOTONIC_RAW for that. I start to get mixed feelings
> about the direction this is going to :-/

CLOCK_MONOTONIC_RAW is not corrected at all. Its frequency might be
better in some specific cases like ntpd correcting the initial offset
on start, but in normal conditions it will most likely be worse than
CLOCK_MONOTONIC.

> CLOCK_MONOTONIC and CLOCK_TAI are both frequency adjusted, to keep as
> close to a SI second as the system permits. I guess you want
> CLOCK_MONTONIC to be only FLL adjusted, because there is no need for a
> fixed phase relation to CLOCK_TAI anyway. IMHO this is an error. It lets
> adjustment errors creep uncontrolled into CLOCK_MONOTONIC, while
> CLOCK_TAI controls the accumulated error via the PLL. Then the elapsed
> time between two events will depend on the clock you use, and I think
> that's evil. We have something similar already.

I'd like CLOCK_MONOTONIC to be only controlled by the PLL/FLL
frequency adjustments (timex->freq), and not by the phase adjustments
(timex->offset).

Yes, the intervals measured by the two clocks would be different, but
that's the point. You can't have one clock which has best accuracy in
both phase and frequency. 

Is there a requirement that CLOCK_MONOTONIC and CLOCK_REALTIME advance
at the same rate? And would it break any applications if they didn't?
In POSIX they seem to be both defined as measuring real time, without
any details on their rate.

-- 
Miroslav Lichvar
_______________________________________________
hackers mailing list
hackers@lists.ntp.org
http://lists.ntp.org/listinfo/hackers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic