Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:cpu_frequency_scaling_basics [2011/11/20 15:07] – [#INTRODUCTION] bmarkuswiki:cpu_frequency_scaling_basics [2014/12/26 06:43] (current) bmarkus
Line 3: Line 3:
 To reduce power consumption is essential for portable computers but there are no reason not to use on desktop machines. You can save power turning off not needed hardware components like WiFi, Bluetooth, turning off or reduce monitor backlight, spinning down HDD and to control CPU frequency. To reduce power consumption is essential for portable computers but there are no reason not to use on desktop machines. You can save power turning off not needed hardware components like WiFi, Bluetooth, turning off or reduce monitor backlight, spinning down HDD and to control CPU frequency.
  
-TC4 activates CPU frequency scaling by default at startup time in case of suitable CPU and enables 'ondemand' governor, which will select automatically frequency based on applications demand.+TC4 activates CPU frequency scaling by default at startup time in case of suitable CPU found and enables 'ondemand' governor, which will select automatically frequency based on applications demand.
  
 In most cases it works fine and you do not need any additional action. In most cases it works fine and you do not need any additional action.
-===== #CPU DRIVER ===== 
  
-Next you have to load the proper CPU kernel driver matching your CPU. To identify the CPU type in a terminal window: +However, as there are certain setups where either not all required drivers are automatically loaded and/or where the 'ondemandgovernor gets prevented from being enabled (due to latency being too high), it is a good idea to do a check based on info which follows whenever running TC4 for the first time with a specific processor or chipset.
- +
-cat /proc/cpuinfo +
- +
-Depending on the CPU, load one of the following modules with the 'modprobecommand: +
- +
-p4-clockmod (Intel) +
-powernow-k6 (AMD K6) +
-powernow-k7 (AMD K7) +
-powernow-k8 (AMD K8) +
-longhaul    (VIA Nehemiah) +
- +
-If you choose wrong driver you will get an error message and module is not loaded, nothing goes wrong. +
- +
-Alternatively you can try +
- +
-acpi-cpufreq +
- +
-It is not so efficient as CPU specific modules, but better than nothing. +
- +
-There are drivers for certain chipsets not only for CPU's but it is out of the scope of this introduction.+
  
  
 ===== #VIEW CPU FREQUENCY INFORMATION ===== ===== #VIEW CPU FREQUENCY INFORMATION =====
  
-Now you can check actual CPU frequency and other informationType in a terminal window:+If you want to view actual CPU frequency settings, install cpufrequtils.tcz extension and use command:
  
 cpufreq-info cpufreq-info
  
-and you will get a similar screen: 
  
-{{"http://tc.hasix.org/scrcap/cpufreqinfo1.png"}} 
  
  
Line 52: Line 29:
 userspace - allows userspace programs (or any process running as root) to set the frequency userspace - allows userspace programs (or any process running as root) to set the frequency
  
-Above governors are modules, loaded automatically when needed, but you can modprobe them before using. Default is performance.+Above governors are modules, loaded automatically when needed, but you can modprobe them before using. TC default is 'ondemand'.
  
-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.+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.
  
  
-===== #SELECT GOVERNOR =====+===== #CHANGING GOVERNOR =====
  
-At this point everything is prepared but no active governor selected and no running third party daemon installedso no any power saving yet.+If you want to use a different governor the 'ondemand'install cpufreq-utils.tcz extension.
  
 Use the 'cpufreq-set' command to activate one of the governors mentioned above, for example: Use the 'cpufreq-set' command to activate one of the governors mentioned above, for example:
  
-cpufreq-set -g ondemand+cpufreq-set -g performance
  
 Please note, if you have a dual-core or multiple-core CPU, you must specify explicitely the CPU. There are CPU's where each core can run with different setting! Example for a dual-core CPU: Please note, if you have a dual-core or multiple-core CPU, you must specify explicitely the CPU. There are CPU's where each core can run with different setting! Example for a dual-core CPU:
Line 83: Line 60:
 ===== #USER SPACE PROGRAMS ===== ===== #USER SPACE PROGRAMS =====
  
-There are user space programs to manage not only cpu frequency but other components also. One of those, cpufreqd is part of the cpufreq.tcel/tcpufreq.tcz extension installed.+There are user space programs to manage not only cpu frequency but other components also. One of those, cpufreqd is available in the repository. 
 + 
 + 
 +===== #TROUBLESHOOTING =====
  
-For the curious there are many good articles on the net.+The following relates to a Pentium M under TC3.8.4 (2.6.33.3 kernel) running on a Dell Precision M70\\ 
 +laptop, but may still be applicable if you run into a similiar problem.\\ 
 +Installed cpufrequtils and selected ondemand govenor. The policy line from the cpufreq-info command read:\\ 
 +<code>current policy: frequency should be within 800 MHz and 800 MHz.</code> 
 +indicated that CPU was locked at 800Mhz. Executing the command: 
 +<code>cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit</code> 
 +returned the value 800000 (frequency in Khz). Using the boot code: 
 +<code>processor.ignore_ppc=1</code> 
 +fixed that. Now bios_limit contains 2267000 (2.267Ghz), the maximum speed for this CPU. Checking\\ 
 +\proc\cpuinfo several times showed that the frequency was bouncing between 800Mhz and 2.27Ghz\\ 
 +even though the machine was not doing anything. Changing the governor to conservative fixed that.\\ 
 +For links to bug reports that helped solve this problem, see:\\ 
 +http://forum.tinycorelinux.net/index.php/topic,14917.msg85013.html#msg85013
Print/export
QR Code
QR Code wiki:cpu_frequency_scaling_basics (generated for current page)