Re: [chrony-users] Using Chrony with a DS3231 RTC without RTC_UIE_ON |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: chrony-users@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-users] Using Chrony with a DS3231 RTC without RTC_UIE_ON
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Mon, 22 Jun 2020 09:51:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592812327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=R1jnZk81m4TQOfXdUMdNXwG7nKwYN2etsscP63EE9Cg=; b=VMbunWQSaI+PeP0qhdI92Wpk98+wG27lpUnh0bunI3chlyQ71MZ2U2TR5Ba5zIaRS4mVar egk4xuGcC8QzZ0mJca6xhqG8crozBlLhEuCJGtAqfD9cwQazplgeEnOePp8XGtHboqXsaQ YuCYI1ag7oHhBq5xkX0HlgO7vRK0Yjc=
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.