Hi.  I have a long-standing problem with timekeeping on my 2xPIII
machine: sooner or later after a reboot, successive calls to
gettimeofday will return large negative deltas (i.e. time goes
backwards).  Several kernel gurus have offered help and patches, but
to no avail; I usually end up just brute-forcing the kernel to never
return a time earlier than one previously returned.

I recently tried 2.3.99-pre7 to see if anything was different (time
is still screwed up); but I added some printk's to see what was
happening.  I've found that in the delay_at_last_interrupt calculation
near .../arch/i386/kernel/time.c:523:

                count = ((LATCH-1) - count) * TICK_SIZE;

the value retrieved from the i8253 timer becomes greater than
(LATCH-1) for some reason, and forever after the clock is unstable.
The correlation seems to be good: the system is OK until the first
time (count > (LATCH-1)), and thereafter both (count > (LATCH-1)) and
negative time steps happen 10's to 100's of times per second.

So I wonder:

* Is the count in the 8253 *always* supposed to be less than LATCH-1
  (==11931)? 

* Is there anything besides flakey hardware that might cause this
  behaviour?

regards,
d.
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/dmentre/smp-howto/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]

Reply via email to