New time code miscalculates cpu usage
Benjamin Herrenschmidt
benh at kernel.crashing.org
Thu Oct 25 07:56:09 EST 2007
On Thu, 2007-10-25 at 00:17 +0400, Sergei Shtylyov wrote:
> Hello.
>
> Olof Johansson wrote:
>
> > Not sure when this started happening, but I wanted to report it. I'll
> > start bisecting in a day or two if noone else has gotten around to
> > looking at it:
>
> > $ echo "int main(void) { while(1); }" > test.c ; gcc test.c
> > $ time ./a.out & sleep 2 ; killall a.out
> > real 0m2.008s
> > user 0m4.014s
> > sys 0m0.002s
> >
> > Seen on POWER5 and PA6T, haven't tried anything else yet.
>
> I'm not surprised -- the kernel accounts twice for each tick.
Your input would be much more valuable if you actually pointed out where
that happens and why since you seem to know it.
Ben.
More information about the Linuxppc-dev
mailing list