Subject: Re: timewarps
To: None <chuq@chuq.com>
From: Scott Hallock <scott@hallocks.net>
List: tech-kern
Date: 03/10/2002 10:06:29
> On Sat, 9 Mar 2002, Chuck Silvers wrote:
> 
> > this appears to be due to successive microtime() results showing time
> > going backwards, which confuses the code that counts process cpu usage.
> > there are several PRs on this phenomenon on the x86 (11432, 14058, 14100)
> > and the second of those has the attached test program to see if gettimeofda
> y()
> > goes backwards.  running that program on this box results in an immediate
> > stream of timewarp events:
> 
> FYI there was a good length thread about this on a FreeBSD mailing list
> (current maybe?) recently.  I didn't really follow the thread, but I seem
> to recall that they had a patch or two for the kernel that fixed this.  It
> did seem to only affect fast machines.

I don't know if my box qualifies as fast (it's fast by my standards, but I
recently saw some plans for an "embedded" system that rely on 2.8GHz Pentium
IVs becoming available).  Over the course of ~12 hours, I got four events.

scotthal2:scotthal[1003]$ dmesg
NetBSD 1.5.3_ALPHA (SCOTTHAL2) #0: Wed Mar  6 19:32:11 MST 2002
    root@scotthal2:/usr/src/sys/arch/i386/compile/SCOTTHAL2
cpu0: AMD Duron (686-class), 601.08 MHz

scotthal2:timewarp[1007]$ ./timewarp
1015755312 515668 < 1015755312 525611
1015755435 939397 < 1015755435 949362
1015755487 292669 < 1015755487 302606
1015755518 658498 < 1015755518 668480

I just set up a FreeBSD 4.5 box.  I'll let timewarp run on it for awhile and
see what I get.

Scott