Re: [chrony-dev] Wake from sleep on OS X |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] Wake from sleep on OS X
- From: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Thu, 3 Dec 2015 04:25:49 +1300
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpcorp.com; s=a0-2; h=Feedback-ID:X-Smtpcorp-Track:To:Message-Id:Date: From:Subject; bh=e9/bak3KAd1JDyHoUdeLZTzwV2rKBGwautIrsO01U+I=; b=PzSwQNWdGE7V UOy5SV+blf8KQAHIAEjjQOOgbZf+w+qUu4ZK3fFIrDRiRpXW7RxwiucJoHO+iVZMBixvVOoNnvCHk 10dDsBfb3Uowsoks0HdIE6DWrrl9diQ7ztxrUOCBu45fwuLPWbbWPHF97+hhUFM+33qsNfwkk1qXA /36x5OJSTyqy486OSDNTjMtSZ4T5hTrqEiFU/ZDfc8uTerkrv4G+u0W3FVZ9M9uuuznsjbK9JLRjs Hdhn6IwLI0yjKx70uiUYILPKhlN8HCAw3Dh9ZUxQuQVPOA2rAtj3XXDsnwuhcOSZf+FkDdW5ew0vG QR7TNtQhHtL1ekBkzZbXSw==;
- Feedback-id: 149811m:149811acx33YQ:149811sT3zs2fOqZ:SMTPCORP
> 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.