[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Bug/limitation in 'time' (kernel setings?)...

From: Bruce Dawson
Subject: RE: Bug/limitation in 'time' (kernel setings?)...
Date: Tue, 19 Mar 2013 13:54:46 -0700

How many CPUs do you have? 20% usage doesn't mean anything without knowing
that. On a five-core system 20% usage would imply one full core.

> It's your kernel settings that are causing issue.

Hmmm? My kernel is correctly ensuring that there is no idle time. It is
switching instantly between bash and expr. If your kernel is not then you
should get that fixed -- going idle is not efficient.

I'm not happy with my kernel for moving the processes around to so many
different cores, but that is by-design, and normally works well. 

I'm also told that 'top' is problematic for determining CPU usage. I'm not
sure what its limitations are.

-----Original Message-----
From: Linda Walsh [mailto:bash@tlinx.org] 
Sent: Tuesday, March 19, 2013 9:10 AM
To: Bruce Dawson; bug-bash
Subject: Re: Bug/limitation in 'time' (kernel setings?)...

Bruce Dawson wrote:
> Hmmm -- again, that doesn't match what I see. bash is suspended while 
> it waits for expr to run, and the instant that expr completes bash runs
> This can be seen in the profiler screenshot. The CPU is busy at all 
> times, and always busy on exactly one process.
        I don't see that on my system.

I ran
exprcount() {
 for (( i=$1;i>0;i=$(expr $i-1) )); do :; done  } time exprcount 1000
2.05sec 0.12usr 1.33sys (71.12% cpu) Ishtar:law/bin> time exprcount 10000
20.43sec 1.62usr 12.98sys (71.48% cpu)
But 'top' never shows over 20% usage , vs.

 function f { i=10000000;while ((i--));do :; done ;} time  f 31.73sec
29.25usr 2.41sys (99.76% cpu)

and top shows 100% cpu usage for 'f'

i.e. My system seems to include scheduling time (or a large part of it) as
part of the 'time' figures.

Note..  you said your loop took 2 seconds on your 3.2GHz sys.

My system was idling at 1.6GHz nearly the whole test.

It's your kernel settings that are causing issue.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]