Difference between revisions of "How to make use of Dynamic Frequency Scaling"

From ThinkWiki
Jump to: navigation, search
(configuring SpeedStep daemons)
Line 9: Line 9:
 
====2.6 kernels====
 
====2.6 kernels====
  
You need to enable the cpu frequency scaling for your kernel:
+
You need to enable the cpu frequency scaling for your kernel (usually your distros kernel will have this enabled):
 
  CONFIG_CPU_FREQ=y
 
  CONFIG_CPU_FREQ=y
  
The 2.6.x Debian kernel packages have this enabled already.
+
You need to load enable governors, if not already done in your distros default kernel:
 +
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 +
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
 +
CONFIG_CPU_FREQ_GOV_USERSPACE=y
  
You need to load a governor:
+
Since 2.6.10 there is the ondemand governor that does cpu frequency scaling in kernel so you dont need userspace programs like powernowd etc.
  set "CONFIG_CPU_FREQ_GOV_PERFORMANCE=y"
+
It can be enabled with:
set "CONFIG_CPU_FREQ_GOV_POWERSAVE=y"
+
  CONFIG_CPU_FREQ_GOV_ONDEMAND=y  
set "CONFIG_CPU_FREQ_GOV_USERSPACE=y" or load module "cpufreq_userspace"
 
set "CONFIG_CPU_FREQ_GOV_ONDEMAND=y"
 
 
 
In Debian kernels it should all be available as modules.
 
  
 
*If you have a Coppermine-piix-smi based Thinkpads like from the A2x, X2x and T2x series you need to enable the <tt>speedstep-ich</tt> driver in the kernel and load it if it's built as module. You might want to look at [[How to get SpeedStep working on Coppermine-piix4-smi based Thinkpads | this page]].
 
*If you have a Coppermine-piix-smi based Thinkpads like from the A2x, X2x and T2x series you need to enable the <tt>speedstep-ich</tt> driver in the kernel and load it if it's built as module. You might want to look at [[How to get SpeedStep working on Coppermine-piix4-smi based Thinkpads | this page]].
  
 
*If you have a p4-class celeron based Thinkpad like the R40e you might want to look at [[How to get SpeedStep working on P4-class-Celeron based Thinkpads | this page]]
 
*If you have a p4-class celeron based Thinkpad like the R40e you might want to look at [[How to get SpeedStep working on P4-class-Celeron based Thinkpads | this page]]
 +
 +
===using the sys interface===
 +
 +
The files in /sys/devices/system/cpu/cpu0/cpufreq/ provide information and a means of controlling the frequency scaling subsystem.
 +
Seed values are given in Khz. You need to be root to access the /sys filesystem.
 +
 +
Your max speed is at /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq.
 +
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
 +
700000
 +
Your min speed is at /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq.
 +
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
 +
500000
 +
You can rite to /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed to change the current speed.
 +
# echo 700000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
 +
# cat /proc/cpuinfo  | grep "cpu MHz"
 +
cpu MHz        : 697.252
 +
# echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
 +
# cat /proc/cpuinfo  | grep "cpu MHz"
 +
cpu MHz        : 976.152
  
 
===configuring SpeedStep daemons===
 
===configuring SpeedStep daemons===
Line 38: Line 56:
 
*[[How to configure powersaved | powersaved]]
 
*[[How to configure powersaved | powersaved]]
 
*[[How to configure powernowd | powernowd]]
 
*[[How to configure powernowd | powernowd]]
*[[Using the sys interface | sys interface]]
+
*[[How to use cpufrequtils | cpufrequtils]]
*[[Using cpufrequtils | cpufrequtils]]
 
  
 
[[Category:570E]] [[Category:600X]] [[Category:A20m]] [[Category:A20p]] [[Category:A20m]] [[Category:A20p]] [[Category:A21e]] [[Category:A21m]] [[Category:A21p]] [[Category:A22e]] [[Category:A22m]] [[Category:A22p]] [[Category:G40]] [[Category:G41]] [[Category:R30]] [[Category:R31]] [[Category:R32]] [[Category:R40]] [[Category:R40e]] [[Category:R50]] [[Category:R50p]] [[Category:R51]] [[Category:T20]] [[Category:T21]] [[Category:T22]] [[Category:T23]] [[Category:T30]] [[Category:T40]] [[Category:T40p]] [[Category:T41]] [[Category:T41p]] [[Category:T42]] [[Category:T42p]] [[Category:X20]] [[Category:X21]] [[Category:X22]] [[Category:X23]] [[Category:X24]] [[Category:X30]] [[Category:X31]] [[Category:X40]]
 
[[Category:570E]] [[Category:600X]] [[Category:A20m]] [[Category:A20p]] [[Category:A20m]] [[Category:A20p]] [[Category:A21e]] [[Category:A21m]] [[Category:A21p]] [[Category:A22e]] [[Category:A22m]] [[Category:A22p]] [[Category:G40]] [[Category:G41]] [[Category:R30]] [[Category:R31]] [[Category:R32]] [[Category:R40]] [[Category:R40e]] [[Category:R50]] [[Category:R50p]] [[Category:R51]] [[Category:T20]] [[Category:T21]] [[Category:T22]] [[Category:T23]] [[Category:T30]] [[Category:T40]] [[Category:T40p]] [[Category:T41]] [[Category:T41p]] [[Category:T42]] [[Category:T42p]] [[Category:X20]] [[Category:X21]] [[Category:X22]] [[Category:X23]] [[Category:X24]] [[Category:X30]] [[Category:X31]] [[Category:X40]]

Revision as of 04:34, 19 April 2005

general

Linux supports Dynamic Frequency Scaling for ThinkPads with mobile Pentium III, Pentium 4 and Pentium M processors.

configuring the kernel

2.4 kernels

Todo...

2.6 kernels

You need to enable the cpu frequency scaling for your kernel (usually your distros kernel will have this enabled):

CONFIG_CPU_FREQ=y

You need to load enable governors, if not already done in your distros default kernel:

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y

Since 2.6.10 there is the ondemand governor that does cpu frequency scaling in kernel so you dont need userspace programs like powernowd etc. It can be enabled with:

CONFIG_CPU_FREQ_GOV_ONDEMAND=y 
  • If you have a Coppermine-piix-smi based Thinkpads like from the A2x, X2x and T2x series you need to enable the speedstep-ich driver in the kernel and load it if it's built as module. You might want to look at this page.
  • If you have a p4-class celeron based Thinkpad like the R40e you might want to look at this page

using the sys interface

The files in /sys/devices/system/cpu/cpu0/cpufreq/ provide information and a means of controlling the frequency scaling subsystem. Seed values are given in Khz. You need to be root to access the /sys filesystem.

Your max speed is at /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq.

# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
700000

Your min speed is at /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq.

# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
500000

You can rite to /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed to change the current speed.

# echo 700000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
# cat /proc/cpuinfo  | grep "cpu MHz"
cpu MHz         : 697.252
# echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
# cat /proc/cpuinfo  | grep "cpu MHz"
cpu MHz         : 976.152

configuring SpeedStep daemons

Don't forget to enable the userspace governor to have a userspace daemon do the frequency scaling. If it is built as module, load it as cpufreq-userspace. Note that since 2.6.10, there is also the ondemand governor in the kernel, which replaces any userspace daemon for cpu scaling and works very well.

There are plenty of userspace frequency scaling daemons available: