Bruce Dawson wrote: > 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. --- If you look at the example that shows no process spawning overhead, it shows 100% cpu usage. 100%=1CPU, regardless of cores. At full load, my system shows 1200% cpu a measured by the standard definition of CPU seconds / real time.
> >> 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. --- Mine shows that for a machine of 50% the speed of yours, it takes the same amount of real time. Mine shows the idle time because it is tuned to show idle time when the cpu is idle. If your kernel is spending 80% of it's time in the scheduler when there are no tasks being scheduled, I'd say you have a problem. You still haven't even mentioned what kernel version you are running nor any of the settings I mentioned. you could start with a dump of your config. gunzip </proc/config.gz >output > 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. --- ??? You can control that with cpuaffinity. You can schedule your test process to run on 1 cpu and everything else to stay off of it. > > I'm also told that 'top' is problematic for determining CPU usage. I'm not > sure what its limitations are. --- Top's output agreed with the output of xosview. I used top to get a more granular picture. I'm not sure how much longer this discussion is of interest to the bug-bash list, since it's pretty clearly not a bash specific issue, but others are quite welcome to jump in and correct me where I'm wrong as they usually do ;-) .