PowerD & Kernel Modules
-
Are there any kernel modules such as cpufreq.ko needed for PowerD?
Reason for the question is that even though pfSense dashboard reports a reduced cpu clock rate, the power does not seem to be reduced. So am wondering if there is some module that needs loaded.
DELL Inspiron 5100 (notebook)
2.1-BETA1 (i386)
built on Fri Feb 1 12:54:35 EST 2013
FreeBSD 8.3-RELEASE-p5 -
The inspiron 5100 has a Pentium 4 CPU yes? A standard desktop CPU?
The Pentium 4 has no power saving features like speedstep. What you are seeing is CPU throttling. See acpi_throttle.
Steve
-
Yes it is Pentium 4 desktop cpu.
So acpi throttling sets the cpu clock frequency via the chipset. Correct?
Shouldn't there still be a pretty significant power savings just from cutting the frequency from max (2.6 GHz) to min (664 MHz)?
-
@acpi_throttle.c:
- Throttling provides relative frequency control. It involves modulating
- the clock so that the CPU is active for only a fraction of the normal
- clock cycle. It does not change voltage and so is less efficient than
- other mechanisms. Since it is relative, it can be used in addition to
- absolute cpufreq drivers. We support the ACPI 2.0 specification.
So it doesn't actually change either the CPU frequency or voltage but simply sets the cpu inactive during a portion of each cycle.
In my testing this provided almost no benefit in power usage. Your mileage may vary. ;)Steve
-
Shouldn't there still be a pretty significant power savings just from cutting the frequency from max (2.6 GHz) to min (664 MHz)?
Not necessarily. If there is no work for the CPU to do, the OS puts the CPU into a halt/idle ("sleep") state where it has greatly reduced power consumption. It gets woken up again by timer events or interrupts (like the NIC having received new data).
With low system load, there will be brief periods of work (with high power consumption) and long periods of "sleep" (with very low power consumption).
If you lower the clock rate, the periods during which the CPU does its work get longer, and it spends less time "sleeping".
Now it depends on how efficient the CPU is when running at a lower clock rate. For example, the Pentium M CPU (1,6GHz) will need 25W when running at full speed and only around 8W when running at half the speed (800MHz). This looks like a huge saving, but it isn't, since the CPU has to work twice as long at 8W than it has to at 25W. Still a saving.
Now let's assume that the mentioned CPU has a power consumption of 3W in the halt/idle state (I have no hard data on the real numbers here, apparently Intel likes to keeps things obscure. That's also the reason why I use the Pentium M as an example - Intel has published at least some numbers here). Furthermore, let's assume a situation where the CPU would have a utilization of 10% at 1.6GHz. This would mean 10% of the time at 25W, 90% of the time at 3W. Total average power would be 5.2W. At 800MHz, it would spend 20% of the time at 8W and 80% at 3W. Average power would be 4.0W. Now what would happen if we lower the clock rate to 400MHz? (I know that's not supported, but let's just assume that we could do it.) The CPU would have to spend about 40% of the time at 6W and 60% at 3W. Average power would be 4.2W. Right - despite slower speed, average power consumption would be actually higher at at 800Mhz!
Of course, the numbers are different for other CPU models. And it also depends on which halt/idle states are supported by the CPU model, the chipset and the OS. And the power supply will different efficiencies at different load levels. Too many variables to calculate power figures, espcially considering the lack of had data from the CPU manufactureres. So the only practical way to figure things out is to measure the power consumption at the wall socket.
In my case, a pfSense system based on an Intel(R) Atom(TM) CPU D2500 @ 1.86GHz will consume 17.3W at idle without PowerD (measured at the wall). With PowerD enabled, it consumes 17.5W in the same situation. Btw, these are the averages from different measurements. At 100% CUP load, it uses 18.0W, regardless of PowerD. So in my case, on my hardware platform, based on my measurements, PowerD should NOT be activated in order to save 1.7kWh per year (which is still less than 1 EUR per year in savings).
Best regards, Klaus
-
Interesting results, thanks for sharing. :)
I would point out though that the biggest gains using Powerd are when your CPU has some sort of dynamic cpu frequency/voltage control that has a freebsd driver, Enhanced Intel Speedstep or AMDs powernow for example. The D2500 does not have speedstep. The Pentium-M does and it showed an overall reduction of system power of 5W (15%) in my testing at idle. I agree though that the lowest power state is in the higher 'C states' and if you have that enabled in the bios, and your ACPI table is complete and correct then you are probably already running at least power. Speedstep 'P states' become important if your CPU is running at a moderate load continuously when there is not much time to use C states. http://www.overclock.net/t/1058894/intel-acpi-guide-c-g-s-p-states-and-ocs
It worth noting that the Pentium-M is a special case here because the frequency/voltage values are hard coded into the est(4) driver and hence cpufreq can use them even if the ACPI table does not play nicely with FreeBSD (many, many bioses!).I have a box in which I replaced the CPU, a P4 2.8GHz, to save power. I didn't need that much processing power. You can save quite a bit by simply using a lower speed P4. I then used a P4-M, which is pin compatible, and saved some more. The P4-M has speedstep though it is very crude, only two steps, but my own board doesn't support it. You are using a laptop though so I would investigate that.
Steve