Arjan van de Ven wrote: > On 2/27/2010 8:41, Tomasz Chmielewski wrote: > >> Does offlining a CPU save power? >> > > the short answer is "not the way you think it does". > > >> For example, if I do something like this on a Core i7 CPU - will it save >> any power? >> >> echo 0> /sys/devices/system/cpu/cpu2/online >> echo 0> /sys/devices/system/cpu/cpu3/online >> echo 0> /sys/devices/system/cpu/cpu4/online >> echo 0> /sys/devices/system/cpu/cpu5/online >> echo 0> /sys/devices/system/cpu/cpu6/online >> echo 0> /sys/devices/system/cpu/cpu7/online >> >> >> Say, I have a PC which needs to be turned on all the time, but is mostly >> idle at night. >> > > > Now there are two questions: > > 1) Does offlining a CPU save energy > 2) Does offlining a CPU save power > > the difference being, that energy is the accumulation over time (the thing > you pay the electricity company), > while power is an instantanious thing. > > Offlining a CPU does not save energy. Best case, you move spread the work out > over time, but that's generally actually > bad for your energy bill, not good. > The case where it would spread work over time is where you have multiple > things to do at the same time. Now, > the way cpus work nowadays, there is a certain of cost you get for having ANY > core active, in addition to the power cost > of the core itself (think "memory controller" and such). In general, once you > pay the cost for getting ANY core active, > it's better to run all things at once. > As a simple math example, > lets say the cpu when entirely idle takes 1 Watt of power > lets say the cost for having any core is 3 Watts > and lets say that the cost for an active core is 10 Watts > (these numbers are completely made up, just to show the point) > > Now, lets say you have two tasks, each taking half a second, and we look at > one second of time > > scenario 1: offline all cores except one => 1 second of activity > total energy = 1 Watt * 1 second + 3 Watts * 1 second + 10 Watts * 1 > seconds = 14 Joules > > scenario 2: all cores active, but idle when not used => 0.5 seconds of > activity, then 0.5 seconds idle > total energy = 1 Watt * 1 second + 3 Watts * 0.5 seconds + 2 * 10 Watts * > 0.5 seconds = 12.5 Joules > > the point? it's generally better to let run things in parallel than to make > them take longer. > > Note: in case you didn't realize this: all such an offline does is put the > CPU in the lowest idle state (C6).. which the kernel also does if > you are not using the CPU.. there's no fundamental difference between the > power an offline CPU takes versus the power an idle cpu takes. > This is the salient point, right here. This answers the original question, and I've wondered about the very same issue, so it answers me, as well.
I think you're coming at this question from a "bigger load" perspective than the original post and I are. We're imagining a "nearly idle" system sitting there at night, eating electricity. For my case, it's doing some cron stuff every few minutes, and running fetchmail a few times each hour. None of that approaches full load for even one CPU. So how do you minimize electrical use for that "nearly idle" system? Some of us have been thinking that since the normal max nighttime load is less than a CPU/core, deliberately idling the rest would reduce electrical consumption. Your statement that the power consumption for an offline core is equal to that of an idle core IS the definitive answer. Leave 'em hot, and they'll keep themselves cool. (Plus if you have an unusual requirement for CPU cycles, you'll be ready.) -- Dale Pontius Senior Engineer IBM Corporation Phone: (802) 769-6850 Tie-Line: 446-6850 email: [email protected] This e-mail and its attachments, if any, may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message from your system without copying it and notify sender of the misdirection by reply e-mail. _______________________________________________ Power mailing list [email protected] http://www.bughost.org/mailman/listinfo/power
