Subject: Re: getrusage() problem in hp300 port??
To: None <thorpej@nas.nasa.gov>
From: None <Havard.Eidnes@runit.sintef.no>
List: port-hp300
Date: 11/20/1997 11:11:07
Hi, Jason, Greg,

>  > Can someone with a NetBSD-1.3_Alpha/hp300 box run this
>  > little proggy to see if they get the same behaviour I'm
>  > seeing under 1.2E on the HP300 port?
>
> Hmm... first guess is that you have 68030s in your hp300s?  One
> my 25MHz 68040 hp380:
>
> basalt:thorpej 256$ ./a.out
> 0 + 54520
> 0 + 50062
> 0 + 50358
> 0 + 57603
> 0 + 57942
> 0 + 58283
> 0 + 58619
> 0 + 58960
> 0 + 56348
> 0 + 56707
> basalt:thorpej 257$
>
> It's important to note that sleep(3) actually _suspends_ execution; the
> process will not accumulate user time during that call.  It _will_,
> however, accumulate user time while user code is executing, and
> on slower processors, that takes longer.  Thus you will see "inflated"
> values for ru_utime as compared to systems with faster processors.

Uh?  I didn't think speed entered the equation at all...

I thought the problem shown by his program on his system (and
reproduced above) is that the combination of ru_utime.tv_sec and
ru_utime.tv_usec isn't monotonically increasing, which looks like a
bug to me.  On one of our 33MHz 68040 hp433 boxes, I see:

% ./a.out
0 + 62440
0 + 64568
0 + 64996
0 + 65427
0 + 61752
0 + 62152
0 + 62554
0 + 62959
0 + 63363
0 + 63766
%

Oops!  Contrary to my initial run already reported directly to Greg,
this one isn't monotonically increasing!  Let's try it again:

% ./a.out
0 + 77434
0 + 80034
0 + 80564
0 + 81096
0 + 81624
0 + 82152
0 + 82680
0 + 88121
0 + 88680
0 + 89239
%

This one looks fine to me.

This particular system is running:

% uname -a
NetBSD dennis.runit.sintef.no 1.3_ALPHA NetBSD 1.3_ALPHA (DENNIS) #1: Fr=
i Nov 14 11:27:21 MET 1997     jarle@dennis.runit.sintef.no:/usr/src/sys=
/arch/hp300/compile/DENNIS hp300
%

and is not running timed or xntpd (for what that information is
worth).  Time for some source digging (although it's fairly unlikely
that I'll be able to spot the problem)...


Regards,

- H=E5vard