lkml.org 
[lkml]   [1996]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subjectthe time problem
In 1.99.2 the time still jumps backward from time to time (with or 
without the Pentium CC). Even though H. G. Wells would have been a
great fan of it, I think the rest of the users won't like it that
much.

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

Ulrich

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

- /* Bump the maxerror field */
- time_maxerror += time_tolerance >> SHIFT_USEC;
- if ( time_maxerror > MAXPHASE )
- time_maxerror = MAXPHASE;
+ /* Bump the maxerror field if synchronized. If the error is to big,
+ * revert to unsynchronized state. That will prevent updates of the
+ * CMOS clock.
+ */
+ if ( time_maxerror < MAXPHASE )
+ time_maxerror += time_tolerance >> SHIFT_USEC;
+ else
+ time_status |= STA_UNSYNC;

/*
* Leap second processing. If in leap-insert state at

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.031 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site