On 05/10/2011 08:36 AM, Alan McKinnon wrote: > I suppose this step-down-through-the-levels nonsense comes from flawed > comparisons with combustion engines and turbines - it makes sense to ramp > these up and down. It does not make sense to do this with a cpu as a cpu is a > completely different beast altogether. It is either doing something or > nothing; actually it never does nothing - it always does something even if > that is just the no-op instruction in a loop. And cpus do not "accelerate" > like engines and use almost no additional power to go from min to max speed. > So when something useful comes along to do, just switch over to max speed and > get the job done.
That's not exactly true. It does take time, aka latency, to move CPUs out of sleep states. Sleep states are partially related to this because once the load on a CPU goes to zero, the governor will, depending on your configuration, put the CPU into a sleep state to conserve power. Waking that sleeping CPU from its deepest sleep state takes an enormous amount of time, in terms of CPU time, so it sometimes behooves the scheduler to be a bit less dogmatic about putting CPUs to bed while there's still work to do.