Re: [chrony-dev] Wake from sleep on OS X

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Thu, Dec 03, 2015 at 04:25:49AM +1300, Bryan Christianson wrote:
> So in the driver initialisation would we we need something like
> 
> if (CNF_GetRtcSync()) {
> 	sync_rtc_id = SCH_AddTimeoutByDelay(SYNC_RTC_INTERVAL, sync_rtc, NULL);
> }

Possibly.

> > I'm just worried the gettimeofday()+settimeofday() call will step
> > the system clock too much. IIRC, "chronyc makestep" was surprisingly
> > inaccurate on some of the systems we support. I think I saw errors in
> > tens of milliseconds, maybe that's because the system call also sets
> > the RTC? Anyway, if it was documented as a drawback of the rtcsync
> > option, I think that would be ok.
> 
> I don't really understand this part - sorry.

Try "chronyc makestep" when the clock is well synchronized and see if
the measured offset doesn't jump. Maybe on OS X it's not a problem,
but at least on one system I think I saw a larger error.

> > As for the settimeofday() update interval, I think that should
> > correspond to the precision of how the kernel sets and reads the
> > RTC. If it just reads seconds and doesn't wait for the interrupt
> > (assuming it's not some special RTC with a sub-second counter), the
> > update interval could be probably much longer than 15 minutes.
> 
> The default Energy Saver setting on OS X is to put the machine to sleep after 10 minutes of inactivity. If the SYNC_RTC_INTERVAL update interval is too high then the clock would never be updated. 

I'm not sure I follow here.

> If we set the timer to fire at, for example, 60 second intervals we would then only do the sync if more than 1 hour has elapsed since the last update and the offset is less than 1 second. No point updating the clock if its wildly off.

Is a timer needed for this? Couldn't be the RTC update a part of
set_sync_status() for instance?

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/