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

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


> On 2/12/2015, at 11:51 PM, Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
> 
> On Wed, Dec 02, 2015 at 02:31:24PM +1300, Bryan Christianson wrote:
> 
>> I think the best option is periodic updates from chronyd via the settimeofday() system call. Nothing else is setting the h/ware clock and since it seems as tho rtc recovery is not supported, settimeofday() wouldn't be trading on anyones toes.
> 
> I think for the rtcsync option that would be a reasonable thing to do.

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);
}

>  
> 
> 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.

> 
> 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. 

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.

-- 
Bryan Christianson
bryan@xxxxxxxxxxxxx




--
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/