From markd@osprey.grizzly.com  Tue Oct 29 20:18:20 1996
Received: from scruz.net (nic.scruz.net [165.227.1.2])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id UAA26389
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 29 Oct 1996 20:18:19 -0800 (PST)
Received: from osprey.grizzly.com by scruz.net (8.7.3/1.34)
	id UAA04224; Tue, 29 Oct 1996 20:18:12 -0800 (PST)
Received: (from markd@localhost) by osprey.grizzly.com (8.7.6/8.7.3) id UAA00491; Tue, 29 Oct 1996 20:18:47 -0800 (PST)
Message-Id: <199610300418.UAA00491@osprey.grizzly.com>
Date: Tue, 29 Oct 1996 20:18:47 -0800 (PST)
From: Mark Diekhans <markd@Grizzly.COM>
Reply-To: markd@Grizzly.COM
To: FreeBSD-gnats-submit@freebsd.org
Subject: User CPU time getting accounting as system time
X-Send-Pr-Version: 3.2

>Number:         1927
>Category:       bin
>Synopsis:       User CPU time getting accounting as system time
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 29 20:20:01 PST 1996
>Closed-Date:    Sun Apr 26 03:15:31 PDT 1998
>Last-Modified:  Sun Apr 26 09:00:00 PDT 1998
>Originator:     Mark Diekhans
>Release:        FreeBSD 2.2-961014-SNAP i386
>Organization:
>Environment:

P5/166, ASUS MB, 32MB ram, Adaptec SCSI

>Description:

I ran an CPU intensive job, timing it with /usr/bin/time and the result was
     2097.84 real         0.00 user      2013.06 sys

which is very wrong, since its almost all user time.  I rebooted and ran
again and got:

     2405.01 real      2025.56 user         2.25 sys

which is as expected.

I had experienced this previously with the times system call in another
program on 2.2-960612-SNAP, bug kern/1500.  This was closed due to not
reproducing it.

>How-To-Repeat:

Unknown.  Problem is intermittent and infrequent.

>Fix:
	
Unknown.

>Release-Note:
>Audit-Trail:

From: se@zpr.uni-koeln.de (Stefan Esser)
To: markd@Grizzly.COM
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1927: User CPU time getting accounting as system time
Date: Wed, 30 Oct 1996 13:19:26 +0100

 Mark Diekhans writes:
 > 
 > P5/166, ASUS MB, 32MB ram, Adaptec SCSI
 > 
 > >Description:
 > 
 > I ran an CPU intensive job, timing it with /usr/bin/time and the result was
 >      2097.84 real         0.00 user      2013.06 sys
 > 
 > which is very wrong, since its almost all user time.  I rebooted and ran
 > again and got:
 > 
 >      2405.01 real      2025.56 user         2.25 sys
 > 
 > which is as expected.
 
 I've seen this multiple times, too. The following is the output 
 of "time make world" over the last two months. As you can see, 
 in 3 out of 51 runs most of the user time got attributed to the
 system time. (ASUS SP3G, AMD 5x86/133, NCR SCSI, Quantum Atlas 2GB,
 16MB RAM (32MB in the last few samples)))
 
     15819.25 real     11900.86 user      2572.80 sys
     16229.11 real     12131.65 user      2651.07 sys
     15555.73 real     11742.57 user      2523.07 sys
     15139.16 real     11507.38 user      2382.72 sys
     15655.92 real     11507.00 user      2116.89 sys
     16311.38 real     12133.03 user      2480.95 sys
     15953.37 real     12124.38 user      2515.52 sys
     16081.60 real     12067.89 user      2495.41 sys
     16144.54 real     12126.24 user      2509.68 sys
     15879.62 real     12055.97 user      2498.81 sys
     15989.01 real     12037.57 user      2499.67 sys
     15885.18 real     12047.95 user      2505.62 sys
     15723.61 real     11966.01 user      2475.55 sys
     15676.32 real     11915.05 user      2472.28 sys
     15759.47 real     12040.03 user      2499.20 sys
     15799.01 real     12056.58 user      2509.78 sys
     15878.07 real     12069.65 user      2487.59 sys
     15975.21 real     12067.11 user      2514.69 sys
     15757.66 real     12049.61 user      2495.99 sys
     17138.65 real     13537.43 user      2668.62 sys
     17364.41 real     13773.14 user      2669.46 sys
     17038.59 real     13498.43 user      2584.88 sys
     15815.96 real     12183.34 user      2596.90 sys
     16077.20 real     12205.27 user      2623.22 sys
     15904.60 real     12203.17 user      2586.70 sys
     16322.77 real     12343.40 user      2688.58 sys
     16230.53 real     12399.03 user      2678.14 sys
     16286.23 real     12228.41 user      2614.34 sys
     16291.47 real     12390.42 user      2681.78 sys
     15068.48 real     11599.29 user      2489.23 sys
     16274.49 real     12475.23 user      2699.11 sys
     16223.23 real     12485.89 user      2702.36 sys
     16140.83 real     12365.74 user      2700.29 sys
     16642.98 real     12825.41 user      2588.91 sys
     16000.19 real      4454.90 user     10203.62 sys
     16626.18 real     12689.98 user      2714.29 sys
     17039.48 real     12971.43 user      2682.71 sys
     16888.59 real     12957.94 user      2716.47 sys
     16899.66 real     12916.22 user      2730.00 sys
     17131.40 real     13208.64 user      2742.89 sys
     17664.34 real     13659.86 user      2765.63 sys
     17714.62 real     13684.26 user      2768.80 sys
     17801.82 real     13794.24 user      2745.24 sys
     18067.02 real     13817.37 user      2742.80 sys
     17937.92 real      5450.79 user     11241.73 sys
     18499.35 real      5558.41 user     11525.37 sys
     18556.16 real     14230.53 user      2881.41 sys
     18533.28 real     14153.93 user      2845.96 sys
     18225.30 real     13641.48 user      3169.55 sys
     18997.92 real     14213.83 user      3346.92 sys
     18852.84 real     14174.29 user      3298.65 sys

From: Tor Egge <Tor.Egge@idt.ntnu.no>
To: markd@grizzly.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1927: User CPU time getting accounting as system time
Date: Wed, 30 Oct 1996 15:29:02 +0100

 > I ran an CPU intensive job, timing it with /usr/bin/time and the result was
 >      2097.84 real         0.00 user      2013.06 sys
 
 Try "vmstat -i; sleep 2; vmstat -i" to see if RTC interrupts are still
 being generated. If not, you may load an lkm that performs an
 "rtcin(RTC_INTR)" call to restart the RTC interrupt.
 
 - Tor Egge

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, markd@Grizzly.COM
Cc:  Subject: Re: bin/1927: User CPU time getting accounting as system time
Date: Thu, 31 Oct 1996 02:24:24 +1100

 >I ran an CPU intensive job, timing it with /usr/bin/time and the result was
 >     2097.84 real         0.00 user      2013.06 sys
 
 The statistics clock has apparently stopped.  This used to cause 0.00 for
 both the user and systm times, but I changed it so that times for short-
 lived processes are counted somewhere, and this has the side effect of
 counting all process times as system times if the statclock stops.
 
 Bruce

From: Peter Wemm <peter@spinner.DIALix.COM>
To: Tor Egge <Tor.Egge@idt.ntnu.no>
Cc: freebsd-gnats-submit@freefall.freebsd.org
Subject: Re: bin/1927: User CPU time getting accounting as system time 
Date: Wed, 30 Oct 1996 23:35:43 +0800

 Tor Egge wrote:
 >> I ran an CPU intensive job, timing it with /usr/bin/time and the result 
 was
 >>      2097.84 real         0.00 user      2013.06 sys
 >  
 >Try "vmstat -i; sleep 2; vmstat -i" to see if RTC interrupts are still
 >being generated. If not, you may load an lkm that performs an
 >"rtcin(RTC_INTR)" call to restart the RTC interrupt.
 
 This shows up rather dramatically on "systat -vmstat".  It loudly yells 
 "The alternate system clock has died!" and switches elsewhere.
 
 Hmm, It's interesting that systat has got special case code to detect 
 this....
 
 Is it really that expensive to do a simple watchdog for this event?
 
 >  - Tor Egge
 
 Cheers,
 -Peter
 
 

From: Mark Diekhans <markd@Grizzly.COM>
To: Tor.Egge@idt.ntnu.no
Cc: FreeBSD-gnats-submit@freebsd.org, Bruce Evans <bde@zeta.org.au>
Subject: Re: bin/1927: User CPU time getting accounting as system time
Date: Wed, 30 Oct 1996 08:34:29 -0800 (PST)

 >> I ran an CPU intensive job, timing it with /usr/bin/time and the result was
 >>      2097.84 real         0.00 user      2013.06 sys
 >
 >Try "vmstat -i; sleep 2; vmstat -i" to see if RTC interrupts are still
 >being generated. If not, you may load an lkm that performs an
 >"rtcin(RTC_INTR)" call to restart the RTC interrupt.
 
 Although user time appears to be working, the above returns
 
 interrupt      total      rate
 clk0 irq0     4836779      100
 rtc0 irq8     6191284      128
 pci irq11      251175        5
 fdc0 irq6           1        0
 sc0 irq1        31291        0
 sio1 irq3      578888       11
 lpt0 irq7         180        0
 psm0 irq12     355659        7
 Total        12245257      253
 
 interrupt      total      rate
 clk0 irq0     4836987      100
 rtc0 irq8     6191551      128
 pci irq11      251184        5
 fdc0 irq6           1        0
 sc0 irq1        31292        0
 sio1 irq3      578888       11
 lpt0 irq7         180        0
 psm0 irq12     355659        7
 Total        12245742      253
 
 Which module you you suggest?
 
 Mark

From: Bruce Evans <bde@zeta.org.au>
To: markd@Grizzly.COM, Tor.Egge@idt.ntnu.no
Cc: bde@zeta.org.au, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/1927: User CPU time getting accounting as system time
Date: Fri, 1 Nov 1996 22:48:43 +1100

 >>> I ran an CPU intensive job, timing it with /usr/bin/time and the result was
 >>>      2097.84 real         0.00 user      2013.06 sys
 >>
 >>Try "vmstat -i; sleep 2; vmstat -i" to see if RTC interrupts are still
 >>being generated. If not, you may load an lkm that performs an
 >>"rtcin(RTC_INTR)" call to restart the RTC interrupt.
 >
 >Although user time appears to be working, the above returns
 >
 >interrupt      total      rate
 >clk0 irq0     4836779      100
 >rtc0 irq8     6191284      128
 
 The rtc seems to be working too.
 
 >Which module you you suggest?
 
 One you write :-).  (Copy an example module and add the above line to it.)
 
 Bruce
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sun Apr 26 03:15:31 PDT 1998 
State-Changed-Why:  
timed out 

From: Peter Wemm <peter@netplex.com.au>
To: Poul-Henning Kamp <phk@FreeBSD.ORG>
Cc: markd@Grizzly.COM, freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/1927 
Date: Sun, 26 Apr 1998 23:55:25 +0800

 Poul-Henning Kamp wrote:
 > Synopsis: User CPU time getting accounting as system time
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: phk
 > State-Changed-When: Sun Apr 26 03:15:31 PDT 1998
 > State-Changed-Why: 
 > timed out
 
 This was actually fixed in rev 1.80 of sys/i386/isa/clock.c and merged to 
 2.2.2 in rev 1.72.2.4
 
 Cheers,
 -Peter
 
 
>Unformatted:
