[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:hardware:cpu_frequency_scaling [2013/12/16 22:20 (UTC)] – [Checking the cpu frequency settings on your computer] metaschima | howtos:hardware:cpu_frequency_scaling [2023/12/11 10:43 (UTC)] (current) – [Introduction] zeebra | ||
---|---|---|---|
Line 3: | Line 3: | ||
====== CPU-frequency scaling on Slackware ====== | ====== CPU-frequency scaling on Slackware ====== | ||
- | ===== Overview | + | ===== Introduction |
- | CPU frequency scaling is carried out by the kernel. Slackware comes with all requirements necessary to use this feature. | + | CPU frequency scaling is carried out by the kernel, there are currently two main ways of thinking about CPU Frequency Scaling, and these are based on the frequency scaling driver which is in use. By default " |
+ | \\ | ||
+ | " | ||
+ | \\ | ||
+ | For older computers with " | ||
+ | \\ | ||
- | ===== Requirements ===== | + | **Available governors** and the **currently used driver** can be seen by using the cpufreq |
- | The kernel options for CPU frequency scaling are as follows. You need both a governor (one set to default) and a driver. | + | < |
- | | + | \\ |
- | | + | ===== Kernel Configuration ===== |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | * ' | + | |
- | * ' | + | |
- | * x86 CPU frequency scaling drivers | + | |
- | * Intel P state control (X86_INTEL_PSTATE [=n]) This driver is mutually exclusive with CONFIG_X86_ACPI_CPUFREQ. It is a newer driver for Sandy Bridge processors and [[https:// | + | |
- | * Processor Clocking Control interface driver (CONFIG_X86_PCC_CPUFREQ) This is only required for HP ProLiant servers, which using this interface. Otherwise, disable it. | + | |
- | * ACPI Processor P-States driver (CONFIG_X86_ACPI_CPUFREQ [=y]) This is the recommended driver for newer CPUs Intel (Enhanced) Speedstep enabled and AMD K10 and newer. | + | |
- | * AMD Opteron/ | + | |
- | * Intel Enhanced SpeedStep (deprecated) (CONFIG_X86_SPEEDSTEP_CENTRINO [=n] This is a deprecated option that has been superseded by CONFIG_X86_ACPI_CPUFREQ, | + | |
- | * Intel Pentium 4 clock modulation (CONFIG_X86_P4_CLOCKMOD [=n]) This is a hack for Pentium 4s that may cause severe slowdowns and noticeable latencies, so disable it. | + | |
- | <note important> | + | Both Kernels (huge/ |
+ | If you want to use a newer Kernel series or your own Kernel, the relevant options are found in the section **" | ||
- | ===== Configuring | + | With AMD you should normally use the acpi-cpufreq driver, but exceptions apply. With Intel you will expose 3 different drivers: **intel_pstate**, **intel_cpufreq** (passive/ |
- | Cpu frequency scaling can be done automatically by a so-called governor, or manually. The governors available are " | + | Generally speaking you could say that Intel P-state is performance biased in general and that acpi-cpufreq gives you the maximum control (including |
- | The stock Slackware kernels are configured for " | + | \\ |
+ | You can pass these options at boot time to the Kernel command line with the bootloader, like Grub2, you add it after the Kernel line, the standard way of passing Kernel parameters at boot. | ||
+ | \\ | ||
+ | <!-- This section was a huge mess, so I removed the content and just added a snip of information here to keep the section. If it needs to be added, it is probably better to add it towards the end of the article to make it look less overwhelming | ||
- | ===== Checking the cpu frequency settings on your computer | + | ===== / |
- | Slackware comes with the cpufrequtils package which helps to configure | + | The main way to adjust |
- | < | + | < |
+ | And by selecting | ||
+ | < | ||
+ | < | ||
+ | # uncomment the line below and edit it to select your choice: | ||
+ | # | ||
+ | </ | ||
- | Or using sysfs: | + | <note important>The necessary setup is done in /etc/rc.d/rc.cpufreq and it reads /etc/default/ |
- | <code>cat /sys/devices/system/cpu/cpu*/cpufreq/ | + | |
- | where " | + | |
+ | After the initial setup of CPU frequency scaling at boot, scaling can also be controlled manually in a variety of ways, as described below.\\ | ||
+ | \\ | ||
- | ===== The configuration | + | ====== Handling of CPU frequency scaling with cpufrequtils and /sys ====== |
- | The cpufrequtils | + | Slackware comes with the '' |
+ | |||
+ | ===== Checking the CPU frequency settings ===== | ||
+ | |||
+ | You can check the settings on your system with the command | ||
+ | <code bash>cpufreq-info</ | ||
+ | |||
+ | Or if you don't have the package installed: | ||
+ | <code bash>cat / | ||
+ | cat / | ||
+ | where " | ||
+ | |||
+ | |||
+ | |||
+ | ===== Setting | ||
+ | <!-- This section is still outdated and should be worked into how to use /sys and cpufrequtils insted. --- // | ||
The '' | The '' | ||
- | ===== Example ===== | + | You can set the scaling governor manually if you want, per cpu core. |
- | On my laptop I have the following lines in my ''/ | + | |
<code bash> | <code bash> | ||
- | # CPU-frequency scaling | ||
cpufreq-set --cpu 0 --governor conservative | cpufreq-set --cpu 0 --governor conservative | ||
cpufreq-set --cpu 1 --governor conservative | cpufreq-set --cpu 1 --governor conservative | ||
</ | </ | ||
- | If using sysfs: | + | The same can be done using sysfs: |
<code bash> | <code bash> | ||
echo " | echo " | ||
Line 65: | Line 80: | ||
as long as the interface exists. | as long as the interface exists. | ||
===== Further reading ===== | ===== Further reading ===== | ||
- | I recommend reading the manpages for cpufreq-info and cpufreq-set. | + | The manpages for '' |
+ | |||
+ | The kernel | ||
A decent explanation of P states and how they are handled in the kernel: https:// | A decent explanation of P states and how they are handled in the kernel: https:// | ||
Line 75: | Line 92: | ||
* Originally written by [[wiki: | * Originally written by [[wiki: | ||
* Updated by [[wiki: | * Updated by [[wiki: | ||
+ | * Updated by [[wiki: | ||
<!-- * Contributions by [[wiki: | <!-- * Contributions by [[wiki: | ||
+ | * Additional resources and sources: [[https:// | ||
+ | * Additional resources and sources: [[https:// | ||
+ | * Additional resources and sources: [[https:// | ||
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
<!-- You must remove the tag-word " | <!-- You must remove the tag-word " | ||
- | {{tag> | + | <!-- Some updates done, more will follow. Specifically a section about /etc/rc.d/ is high priority |
+ | {{tag> |