[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: proposed changes to hwclock



On Thu, 10 Feb 2000, Dylan Paul Thurston wrote:
> On Thu, Feb 10, 2000 at 02:55:54PM -0200, Henrique M Holschuh wrote:
> >   1.  Detect sign changes in the computed drift _when_in_CHANGE_DRIFT_mode_,
> >       by comparing the new calculated value with the old one in
> >       /etc/adjtime. ...
> 
> I don't see why this is necessary.  Surely modification 2 below would catch
> everything this would catch, and this could be bad in some cases.  Imagine

Group 3 Modification 2 might catch almost everything that Group 3
Modification 1 catches, but that requires a rather small limit for
modification 2 and this is likely to cause a LOT of problems.  The RTC
systematic drift varies with temperature.

> that the RTC has no systematic drift, but is not quite consistent; then
> hwclock would complain loudly about a clock that is more-or-less accurate.

hwclock cannot deal with, and should not be used to correct drift of RTCs
which don't have a reasonably stable systematic drift. This is a limitation
of the model for the RTC that hwclock uses.

I'd rather have hwclock complaining that something is wrong, than allowing
the user to shoot himself trying to use hwclock with a RTC it cannot
correct...

> Certainly the drift calculation would not be terribly useful in this case,
> but there are plenty of other cases like that (whenever the drift varies too
> much) and I don't see why you single out this case.

Group 3 has the sole objective of trying to notice when the RTC (or the
system clock) has been (substantially) altered using something else than
hwclock.

IF hwclock is being used to correct the drift of a compatible (reasonably
constant systematic drift) RTC, AND the drift crosses 0 (change signs), THEN
one is almost sure that the user has adjusted the clocks using something
else than hwclock.

On the other hand, it _is_ feasible that a normal RTC would change drift
direction if the temperature varies enough and the RTC drift is close to
zero. One would need to do field tests to verify if this is common or not (I
just thought of laptops. They are subject to variations of 10, sometimes 20
degrees Celsius in certain places/seasons...)

Maybe group 3 modification 1 should be discarded, after all.

> Also, should there be a limit on the absolute value of the drift as well?

Group 2 modifications 1 and 3 should limit the absolute value of the drift,
I think.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh 


Reply to: