Andre Przywara | 615b730 | 2012-09-04 08:28:07 +0000 | [diff] [blame] | 1 | Processor boosting control |
| 2 | |
| 3 | - information for users - |
| 4 | |
| 5 | Quick guide for the impatient: |
| 6 | -------------------- |
| 7 | /sys/devices/system/cpu/cpufreq/boost |
| 8 | controls the boost setting for the whole system. You can read and write |
| 9 | that file with either "0" (boosting disabled) or "1" (boosting allowed). |
| 10 | Reading or writing 1 does not mean that the system is boosting at this |
| 11 | very moment, but only that the CPU _may_ raise the frequency at it's |
| 12 | discretion. |
| 13 | -------------------- |
| 14 | |
| 15 | Introduction |
| 16 | ------------- |
| 17 | Some CPUs support a functionality to raise the operating frequency of |
| 18 | some cores in a multi-core package if certain conditions apply, mostly |
| 19 | if the whole chip is not fully utilized and below it's intended thermal |
Lukasz Majewski | 0636f0c | 2013-12-20 15:24:53 +0100 | [diff] [blame] | 20 | budget. The decision about boost disable/enable is made either at hardware |
| 21 | (e.g. x86) or software (e.g ARM). |
Andre Przywara | 615b730 | 2012-09-04 08:28:07 +0000 | [diff] [blame] | 22 | On Intel CPUs this is called "Turbo Boost", AMD calls it "Turbo-Core", |
| 23 | in technical documentation "Core performance boost". In Linux we use |
| 24 | the term "boost" for convenience. |
| 25 | |
| 26 | Rationale for disable switch |
| 27 | ---------------------------- |
| 28 | |
| 29 | Though the idea is to just give better performance without any user |
| 30 | intervention, sometimes the need arises to disable this functionality. |
| 31 | Most systems offer a switch in the (BIOS) firmware to disable the |
| 32 | functionality at all, but a more fine-grained and dynamic control would |
| 33 | be desirable: |
| 34 | 1. While running benchmarks, reproducible results are important. Since |
| 35 | the boosting functionality depends on the load of the whole package, |
| 36 | single thread performance can vary. By explicitly disabling the boost |
| 37 | functionality at least for the benchmark's run-time the system will run |
| 38 | at a fixed frequency and results are reproducible again. |
| 39 | 2. To examine the impact of the boosting functionality it is helpful |
| 40 | to do tests with and without boosting. |
| 41 | 3. Boosting means overclocking the processor, though under controlled |
| 42 | conditions. By raising the frequency and the voltage the processor |
| 43 | will consume more power than without the boosting, which may be |
| 44 | undesirable for instance for mobile users. Disabling boosting may |
| 45 | save power here, though this depends on the workload. |
| 46 | |
| 47 | |
| 48 | User controlled switch |
| 49 | ---------------------- |
| 50 | |
Lukasz Majewski | 0636f0c | 2013-12-20 15:24:53 +0100 | [diff] [blame] | 51 | To allow the user to toggle the boosting functionality, the cpufreq core |
| 52 | driver exports a sysfs knob to enable or disable it. There is a file: |
Andre Przywara | 615b730 | 2012-09-04 08:28:07 +0000 | [diff] [blame] | 53 | /sys/devices/system/cpu/cpufreq/boost |
| 54 | which can either read "0" (boosting disabled) or "1" (boosting enabled). |
Lukasz Majewski | 0636f0c | 2013-12-20 15:24:53 +0100 | [diff] [blame] | 55 | The file is exported only when cpufreq driver supports boosting. |
| 56 | Explicitly changing the permissions and writing to that file anyway will |
| 57 | return EINVAL. |
Andre Przywara | 615b730 | 2012-09-04 08:28:07 +0000 | [diff] [blame] | 58 | |
| 59 | On supported CPUs one can write either a "0" or a "1" into this file. |
| 60 | This will either disable the boost functionality on all cores in the |
Lukasz Majewski | 0636f0c | 2013-12-20 15:24:53 +0100 | [diff] [blame] | 61 | whole system (0) or will allow the software or hardware to boost at will |
| 62 | (1). |
Andre Przywara | 615b730 | 2012-09-04 08:28:07 +0000 | [diff] [blame] | 63 | |
| 64 | Writing a "1" does not explicitly boost the system, but just allows the |
Lukasz Majewski | 0636f0c | 2013-12-20 15:24:53 +0100 | [diff] [blame] | 65 | CPU to boost at their discretion. Some implementations take external |
| 66 | factors like the chip's temperature into account, so boosting once does |
| 67 | not necessarily mean that it will occur every time even using the exact |
| 68 | same software setup. |
Andre Przywara | 615b730 | 2012-09-04 08:28:07 +0000 | [diff] [blame] | 69 | |
| 70 | |
| 71 | AMD legacy cpb switch |
| 72 | --------------------- |
| 73 | The AMD powernow-k8 driver used to support a very similar switch to |
| 74 | disable or enable the "Core Performance Boost" feature of some AMD CPUs. |
| 75 | This switch was instantiated in each CPU's cpufreq directory |
| 76 | (/sys/devices/system/cpu[0-9]*/cpufreq) and was called "cpb". |
| 77 | Though the per CPU existence hints at a more fine grained control, the |
| 78 | actual implementation only supported a system-global switch semantics, |
| 79 | which was simply reflected into each CPU's file. Writing a 0 or 1 into it |
| 80 | would pull the other CPUs to the same state. |
| 81 | For compatibility reasons this file and its behavior is still supported |
| 82 | on AMD CPUs, though it is now protected by a config switch |
| 83 | (X86_ACPI_CPUFREQ_CPB). On Intel CPUs this file will never be created, |
| 84 | even with the config option set. |
| 85 | This functionality is considered legacy and will be removed in some future |
| 86 | kernel version. |
| 87 | |
| 88 | More fine grained boosting control |
| 89 | ---------------------------------- |
| 90 | |
| 91 | Technically it is possible to switch the boosting functionality at least |
| 92 | on a per package basis, for some CPUs even per core. Currently the driver |
| 93 | does not support it, but this may be implemented in the future. |