[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Latest Power Management tool for AMD64



T o n g a écrit :
My CPU is AMD 64. What's the latest and easiest power management tool for AMD64?

powernowd is less complicated than cpufreqd or cpudyn, but I also heard sayings that the 2.6 kernel ondemand cpufreq governor might be even more simpler, and there are many other tools like acpid, powersaved, powertop, etc, etc.

I personally use 'powernowd' with my Athlon 64 X2 desktop CPU, but it is true that the kernel's ondemand governor is "simpler" in the sense that it can be used without having to install (and configure) other software.

If you choose to use software to control CPU frequency, it probably will have to be configured just once, and thereafter will be as "simple" to use as the kernel governors.


CPU power management has always been a problem to me, I never get it worked before for my desktop PC. Any hint or points to detailed explanations/steps is appreciated.

It can be true -- in the case of 'powernowd', for example -- that there are some hurdles to get by before the CPU frequency control software will work. On Ubuntu, just installing 'powernowd' doesn't actually enable it; only editing /etc/default/powernowd gets it working. I use Debian, so installing it enables it... except Debian kernels have as many kernel features as possible compiled into loadable modules, so I had to add a couple of lines to /etc/modules to make the appropriate kernel modules available at boot:

    cpufreq_userspace
    powernow-k8

Debian-based distributions provide for tweaking of 'powernowd' settings in /etc/default/powernowd. (See 'man powernowd' for details.)

For the kernel governors, some good explanations can be found in the kernel documentation. You can install and unpack the package 'linux-source-<version>' on your system, or it is not too difficult to find the same reading material on the internet. If you look in

    linux-source-<version>/Documentation/cpu-freq

For example, the file "governors.txt" has a description of how the various kernel governors (such as "ondemand") function, and how you can control them.


thveillon.debian wrote:
I use cpufreq ondemand compiled inside the kernel, no userspace daemon,
only libcpufreq and cpufrequtils to interact with the kernel.
On an amd64 x2 the results are very good since the cpu supports more
speed steps, on the other hand there is not much to gain on my intel
core2duo since it only have a few steps, the lower being 2Ghz for a
2.66Ghz cpu.

Yes, your description of the difference between AMD and Intel CPUs reminds me of something I read in the package description of 'powernowd':

$ apt-cache show powernowd
[...]
 The name is somewhat misleading, as any CPUfreq capable processor will
 work, not just those from AMD.  However, it works better on CPUs that
 support more than two speed steps, like those with AMD's PowerNow! or
 Intel's Pentium M series.
 .
 This daemon is less complicated than cpufreqd or cpudyn, at the cost of
 absolutely depending on a 2.6 kernel with the userspace governor and
 sysfs support enabled.


In my (limited) experience ondemand is the only governor worse using,
other aren't doing much or they simply slow things down by always
reducing the cpu frequency.

Well, this is Linux, so you can usually expect to find more options for customizing than you care to read about! ;)

In the case of 'powernowd', for example, it is possible to control things like:

  - polling time (how often frequency adjustments are made)
  - upper and lower CPU usage thresholds (which control the decision
    about whether to step CPU frequency up or down)
  - step size (how much frequency is altered when stepped up or down...
    though this is very much constrained by hardware limitations)
  - mode (basic behavior of the CPU governor)

The 'powernowd' software defaults to "aggressive" mode, which jumps the CPU frequency to maximum when the upper threshold on CPU usage is reached. This is what I use, and I set both the lower and upper boundaries quite low in order to kick the CPU into high gear easily, and keep it there as long as anything is going on.

In spite of these tweaks my CPU typically stays at it's minimum frequency, which is not a problem since most daily tasks simply don't require maximum horsepower. The moment I start doing anything that even resembles demanding behavior, the system immediately jumps to maximum frequency, just the way I like it!


My kernels have been home-rolled for a long time, I don't now the
default cpufreq governor in Debian kernels, I would guess "userspace" as
for most distributions.

A stock Debian kernel is configured this way:

$ grep FREQ /boot/config-2.6.28-1-amd64
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=m
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
CONFIG_X86_ACPI_CPUFREQ=m
# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set

The default kernel governor is ONDEMAND, so Tong has probably been using CPU frequency controls all along without knowing it. :) The other governors are also available, and switching between them is very easy.


Dave W.


Reply to: