Introduce a dedicated sysctl for logging the Rea/Set RTC messages.
On systems booted with bootverbose those otherwise log on console
regularly which otherwise might be silent.
Reviewed by:
MFC After: 2 weeks
Differential Revision: ...
Differential D30361
arm64/rk805: hide RTC logging behind sysctl not bootverbose bz on May 20 2021, 4:54 PM. Authored by Tags None Referenced Files
Details
Introduce a dedicated sysctl for logging the Rea/Set RTC messages. Reviewed by:
Diff Detail
Event TimelineComment Actions But what I want to know is why do we regularly read the time? Normally this is read only at boot or resume. It is only written when we step the time (which is quite rare). Comment Actions I don't see those message after boot on the console so same as imp I'm wondering why you see them. Comment Actions I think READ only happened once but "Set" looked liked this (from an old console log); every 30 minutes. rk805_pmu0: Set RTC at 2021-05-20 12:57:55[.735434751] Comment Actions I didn't had ntpd running, now I have and I do see the printf. Comment Actions If I had to bet it's sys/kern/kern_ntptime.c::periodic_resettodr() which has a default of 1800. Comment Actions Yea, that's crazy. We need to estimate how long it would take to accumulate 0.5s of error for this call to be useful (since we're not waiting for top of second to set it). 100ppm error this is 5000 seconds (or 83 minutes). That's the max error ntpd can tolerate. The typical ntpd error is closer to 10ppm or 1ppm. 10ppm would dictate closer to twice a day (every 13-14 hours). I think the default should change to something more like 40k-50k seconds. I'll take care of that. Even with that change, this would be a bit noisy, so I'm OK with it. manu? Comment Actions I don't know, for me bootverbose is not only for boot only messages but also include diagnostic at runtime, so I'm not surprised to see random messages on the console. Comment Actions
In that case should we entirely drop it as sys/kern/subr_rtc.c::settime_task_func() will log that case already if bootverbose is enabled (so we'd already get a log entry)? Comment Actions Oh, wait, that's ntpd's steering error, not the RTC error, which is uncorrelated to anything else w/o good intel about the system... 30 minutes is too often, but how to compute something better is well beyond the scope of this review... Comment Actions arm64/rk805: remove RTC Set logging NTP code triggers a regular write of the RTC which logs on console when booted bootverbose. Remove the printf as settime_task_func() will already log errors under bootverbose (which is really what we are interested in). We leave the RTC Read which should only happen once on boot. Comment Actions "When ntpd is synchronizing the system time, it also periodically (30m) syncs the might be better. The key point is that this is normal activity from ntpd, not something |