Throttling

From ZENotes
(Difference between revisions)
Jump to: navigation, search
 
m (1 revision)
 

Latest revision as of 23:59, 14 October 2011

Contents

1. check that the module is loaded

 cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

should return something like

ondemand

If not, check again for acpi presence

lsmod|grep acpi

and if you don't have something similar to

acpi_cpufreq           12365  1

Then you are in trouble; try as rot to do modprobe acpi_cpufreq

then check again. If not, refer to the following weblink to learn where to look for available modules for your kernel/system

http://www.redhat.com/docs/wp/performancetuning/powermanagement/cpufreq_setup.html

2. Available options

This section lists and describes the different types of CPUfreq governors available.

cpufreq_performance

The Performance governor forces the CPU to use the highest possible clock frequency. This frequency will be statically set, and will not change. As such, this particular governor offers no power saving benefit. It is only suitable for hours of heavy workload, and even then only during times wherein the CPU is rarely (or never) idle. cpufreq_powersave

By contrast, the Powersave governor forces the CPU to use the lowest possible clock frequency. This frequency will be statically set, and will not change. As such, this particular governor offers maximum power savings, but at the cost of the lowest CPU performance.

The term "powersave" can sometimes be decieving, though, since (in principle) a slow CPU on full load consumes more power than a fast CPU that is not loaded. As such, while it may be advisable to set the CPU to use the Powersave governor during times of expected low activity, any unexpected high loads during that time can cause the system to actually consume more power.

The Powersave governor is, in simple terms, more of a "speed limiter" for the CPU than a "power saver". It is most useful in systems and environments where overheating can be a problem.

cpufreq_ondemand

The Ondemand governor is a dynamic governor that allows the CPU to achieve maximum clock frequency when system load is high, and also minimum clock frequency when the system is idle. While this allows the system to adjust power consumption accordingly with respect to system load, it does so at the expense of latency between frequency switching. As such, latency can offset any performance/power saving benefits offered by the Ondemand governor if the system switches between idle and heavy workloads too often.

For most systems, the Ondemand governor can provide the best compromise between heat emission, power consumption, performance, and manageability. When the system is only busy at specific times of the day, the Ondemand governor will automatically switch between maximum and minimum frequency depending on the load without any further intervention.

cpufreq_userspace

The Userspace governor allows userspace programs (or any process running as root) to set the frequency. This governor is normally used in conjunction with the cpuspeed daemon. Of all the governors, Userspace is the most customizable; and depending on how it is configured, it can offer the best balance between performance and consumption for your system.

cpufreq_conservative

Like the Ondemand governor, the Conservative governor also adjusts the clock frequency according to usage (like the Ondemand governor). However, while the Ondemand governor does so in a more aggressive manner (i.e. from maximum to minimum and back), the Conservative governor switches between frequencies more gradually.

This means that the Conservative governor will adjust to a clock frequency that it deems fitting for the load, rather than simply choosing between maximum and minimum. While this can possibly provide significant savings in power consumption, it does so at an ever greater latency than the Ondemand governor.


More on the original redHat page: http://www.redhat.com/docs/wp/performancetuning/powermanagement/governor_types.html

3. Enabling a new governor

echo [governor] > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Where [governor] is any of the above listed items like conservative and such

4. Get Info on your system status & fine tune it

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

will give you the current governor


To view the current value of each tunable, use cat [tunable]. For example, to view the current speed of cpu0 (in KHz), use:

cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq.

Once you've chosen an appropriate CPUfreq governor, you can further tune the speed of each CPU using the tunables found in /sys/devices/system/cpu/[cpu ID]/cpufreq/.

To change the value of each tunable, use

echo [value] > /sys/devices/system/cpu/[cpu ID]/cpufreq/[tunable]. 

For example, to set the minimum clock speed of cpu0 to 360 KHz, use:

echo 360000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

These tunables are:

   * cpuinfo_min_freq — Shows the CPU's available minimum operating frequency (in KHz).
   * cpuinfo_max_freq — Shows the CPU's available maximum operating frequency (in KHz).
   * scaling_driver — Shows what CPUfreq driver is used to set the frequency on this CPU.
   * scaling_available_governors — Shows the CPUfreq governors available in this kernel. If you wish to use a CPUfreq governor that is not listed in this file, refer to Enabling a CPUfreq Governor in Section 3.1, “CPUfreq Setup” for instructions on how to do so.
   * scaling_governor — Shows what CPUfreq governor is currently in use. To use a different governor, simply use echo [governor] > /sys/devices/system/cpu/[cpu ID]/cpufreq/scaling_governor (refer to Enabling a CPUfreq Governor in Section 3.1, “CPUfreq Setup” for more information).
   * cpuinfo_cur_freq — Shows the current speed of the CPU (in KHz).
   * scaling_available_frequencies — Lists available frequencies for the CPU, in KHz.
   * scaling_min_freq and scaling_max_freq — Sets the policy limits of the CPU, in KHz.
     

Important

   * When setting policy limits, you should set scaling_max_freq before scaling_min_freq.
   * affected_cpus — Lists CPUs that require frequency coordination software.
   * scaling_setspeed — Used to change the clock speed of the CPU, in KHz. You can only set a speed within the policy limits of the CPU (as per scaling_min_freq and scaling_max_freq).

Read more:

http://www.redhat.com/docs/wp/performancetuning/powermanagement/tuning_cpufreq_policy_and_speed.html

This info was stolen here:

http://www.redhat.com/docs/wp/performancetuning/powermanagement/alpm.html

for my personnal purposes; I find it much more easy to gather the kind of info I need for each re-install in one single place; it's much more effective than Social Bookmarks since the docs I am pumping info from may change, get adapted for other purposes than mine, or just disappear.

the RedHat docs is a true GoldMine of info for Fedora users, the main "power" page starts here:

http://www.redhat.com/docs/wp/performancetuning/powermanagement/index.html

And the full core starts here: http://www.redhat.com/docs

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox