[316] in netbsd-help mailing list archive

home help back first fref pref prev next nref lref last post

xload & CPU time.....

daemon@ATHENA.MIT.EDU (I-Lin Wang)
Fri Sep 8 08:25:14 1995

From: I-Lin Wang <ilin@MIT.EDU>
To: netbsd-help@MIT.EDU
Date: Fri, 08 Sep 1995 08:24:56 EDT

Hi,
	I am confused by 2 starnge situations I found in my NetBSD machine.

1. as I emailed before, I found the xload representing some jobs is
consuming my system load, but I do not find any job doing in the
background. Even if I logout and login again, and use xload, I did
nothing, but the xload still represents a high horizontal line instead of
remain in the buttom. (I close all the x applications, and use fg or jobs
to see if any jobs are running in the background, but I did not find
any.)(also, this situation happens sometimes, sometimes it remains in the
buttom, sometimes it remains in some higher horizontal line, although I do
not have any jobs running in the background.) Isn't this strange??

2. my thesis is related with CPU time for algorithms. The algorithm has 4
procedures, and I have to compute the CPU time takes for these 4
procedures respectively, also I have to compute the overall CPU times for
these 4 procedures. 
   I did some tests few days ago, running the same data with the same
codes on different machines(DEC 5000, SUN classics, SUN spark5(?, sorry I
forgot the name, it's the new SUN athena machine), and on my NetBSD P75
machine. For the overall CPU time, the SUN spark station is the fastest,
then my NetBSD, then SUN classics, then the DEC 5000.
   However, I found the CPU time in my NetBSD a little strange. For the
overall CPU time, it looks fine. But for the 4 procedures' CPU time
respectively, sometimes I will get the numbers like:(in seconds)

  CPU time in procedure 1 is 11964714.850000--->this CPU time is too large
  CPU time in procedure 2 is -28689579.900000-->how can it be negative?  
  CPU time in procedure 3 is 2.650000
  CPU time in procedure 4 is 312204.766667-->this no. is also too large
  CPU time in total is 973.916667

As you can see, the CPU time in total looks fine and reasonable, which
should be around the sum of all the CPU times in procedures 1,2,3 & 4. But
here, the CPU time in 1,2 & 4 look very strange. IF I run this in the
workstation machine(SUN or DEC) I always get something like

  CPU time in procedure 1 is 502.400000
  CPU time in procedure 2 is 8.650000
  CPU time in procedure 3 is 3.633333
  CPU time in procedure 4 is 5.116667
  CPU time in total is 523.050000

I use gcc, and use times() function to record the time before & after
executing procedure i(i=1,2,3,4), and get all the CPU times respectively.
I think it's very unreasonable to get a very large CPU time or a negative
CPU time. However, the total CPU time is fine. This situation happens
sometimes in my NetBSD machine, but it never happens in the SUN or DEC.

	Does anyone have some ideas about what happens in these 2 cases as
I described above? Please feel free to give me any advice. Thanks.

						I-Lin

home help back first fref pref prev next nref lref last post