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