> On 1/12/2015, at 9:00 PM, Miroslav Lichvar <[email protected]> wrote:
> 
> On Tue, Dec 01, 2015 at 11:14:51AM +1300, Bryan Christianson wrote:
>> When the machine wakes up I see syslog messages such as:
>> Dec  1 00:00:28 number9 chronyd[3450]: Forward time jump detected!
>> Dec  1 00:00:52 number9 chronyd[3450]: System clock wrong by 5.978007 
>> seconds, adjustment started
>> Dec  1 07:30:07 number9 chronyd[3450]: Forward time jump detected!
>> Dec  1 07:30:31 number9 chronyd[3450]: System clock wrong by 6.672551 
>> seconds, adjustment started
>> Dec  1 08:10:13 number9 chronyd[3450]: Forward time jump detected!
>> Dec  1 08:10:37 number9 chronyd[3450]: System clock wrong by 6.625014 
>> seconds, adjustment started
>> 
>> And then it can take a couple of minutes before the local offset converges 
>> to something less than a millisecond.
> 
> It looks like the RTC is off by 6 seconds. Is it not synchronized by
> the kernel automatically?

I am not sure what mechanisms are used when the kernel sleeps. I would expect 
the RTC to have been updated but maybe it isn't. Apple docs don't seem to cover 
this very well. I've been unable to find anything equivalent to hwclock to do 
the RTC update.

When chronyd wakes from sleep, won't it see the abrupt change in time as a step 
and start compensating for that? 

In SCH_MainLoop(),  'saved_time' would be the time before sleep and 'now' would 
be the current time. This would trigger the warning from check_current_time()

I was thinking maybe the scheduler should do nothing until the system notifies 
that it is fully awake and then it may need to reset some internal state.

> It's not clear to me what the result should be. Faster detection of
> the forward time jump, or faster adjustment of the clock when it's
> detected?

I think we could be detecting a jump when there is none, just that we have 
inconsistent state for the first cycle on wakeup and then start compensating 
for differences that don't exist.

-- 
Bryan Christianson
[email protected]




--
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].

Reply via email to