[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 08:45:55 -0700

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 again.
This can be seen in the profiler screenshot. The CPU is busy at all times,
and always busy on exactly one process.

The scheduler is invoked whenever one process readies another so the time
slice length doesn't matter in this scenario -- bash resumes execution the
instant that expr completes. If the scheduler didn't do this -- instantly
wake up a process when its wait is satisfied -- then vast amounts of time
would be wasted.

The time slice length is, I believe, only relevant for preempting processes.
On a heavily loaded system processes are time sliced between CPUs at a
resolution dictated by the time slice length, but since my system is 90+%
idle this isn't relevant.

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

I think you misunderstand...what Pierre is saying -- your process is
scheduled out to give others a *chance* to run and the scheduler isn't
called often enough to roll you back in immediately when it finds out that
no one else needs their time ticks...

That's why I mentioned all of the scheduling info in the kernel.

Another thing to play with is length of time slices, but I have a feeling as
soon as you hit the eval you are yielding the cpu to the scheduler, so while
you may be *waiting* 100% on the cpu, much of that is spent waiting for cpu,
not using cpu.

Bruce Dawson wrote:
> Thanks Pierre.
> The profile results, especially the zoom profiler screen shot, show 
> that virtually all of the CPU time being consumed is from bash and its 
> child processes. The system is otherwise idle with no other processes 
> running to any significant degree. My system is ~99.5% idle when I'm 
> not running the test, and ~91.5% idle when the test is running.

> -----Original Message-----
> From: Pierre Gaston [mailto:pierre.gaston@gmail.com] For what it's 
> worth, I still thinks that time is not lying (though the man page 
> warns about possible inaccuracies), Your loop with expr might be "cpu 
> bound" but it does not run often because other processes are given a 
> chance to run.

reply via email to

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