Re: [chrony-users] Using Chrony with a DS3231 RTC without RTC_UIE_ON

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


On Sat, Jun 20, 2020 at 08:03:06PM -0700, Hal Murray wrote:
> 
> mlichvar@xxxxxxxxxx said:
> > It seems hwclock has a fallback to handle RTCs without interrupts by reading
> > the RTC time in a busy loop. I don't think that would be acceptable for
> > chronyd to consume 100% of a CPU core just to track an RTC. 
> 
> The RTC is a clock rather than a source of arbitrary pulses.  You should be 
> able to predict when it will tick and start polling a bit before that.  It 
> would be an interesting experiment to see how much CPU it takes and/or how 
> accurately you can locate the ticks.

As an experiment, yes, that would be interesting. As something
supported in chrony, I don't like the idea much. If the HW or driver
doesn't support interrupts, I'd leave that to hwclock.

> Note that if you guess wrong (aka late) you can stop spinning after a short 
> while and try again for the next tick.
> 
> If you have no idea when it will tick, you can probably do a binary search.

The polling GPIO PPS driver works a bit like that. For the initial
search, it doesn't do a binary search (that would be an interesting
feature), but polls the GPIO every 100 microseconds and then it aims
a busy loop with up to 2000 reads of the clock to contain the pin
value change.

-- 
Miroslav Lichvar


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


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