the time problem

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Tue, 14 May 1996 09:15:58 +0200


In 1.99.2 the time still jumps backward from time to time (with or=20
without the Pentium CC). Even though H. G. Wells would have been a=20
great fan of it, I think the rest of the users won't like it that=20
much.

If I run a simple test program in X11, it is sufficient to run a=20
"find /" in another window mo make time jump backwards from time to=20
time. Interestingly the amount of missing time is about 9900=B5s (one=20
tick).

Ulrich

I also have a patch against 1.99.2 that does not solve the above=20
problem, but switches the kernel clock back to (default) STA_UNSYNC=20
if the clock has not been synchronized for a longer time (which is=20
true if you have killed xntpd after it once sychronized the kernel=20
clock). This will happen if the maximum clock error exeeds 50%=20
(512000=B5s). That way the CMOS clock isn't updated further. For the=20
first time this is not in the NTP specs, but it has been suggested to=20
be added.

--- kernel/sched.c 1996/05/12 16:49:01 1.4
+++ kernel/sched.c 1996/05/12 18:08:12 1.5
@@ -671,10 +671,14 @@
{
long ltemp;
=20
- /* Bump the maxerror field */
- time_maxerror +=3D time_tolerance >> SHIFT_USEC;
- if ( time_maxerror > MAXPHASE )
- time_maxerror =3D MAXPHASE;
+ /* Bump the maxerror field if synchronized. If the error is to big=
,
+ * revert to unsynchronized state. That will prevent updates of th=
e
+ * CMOS clock.
+ */
+ if ( time_maxerror < MAXPHASE )
+ time_maxerror +=3D time_tolerance >> SHIFT_USEC;
+ else
+ time_status |=3D STA_UNSYNC;
=20
/*
* Leap second processing. If in leap-insert state at