Cpupower: Difference between revisions
From wikinotes
(Created page with "Manages cpu frequency. = Install = <blockquote> <syntaxhighlight lang="bash"> pacman -S cpupower </syntaxhighlight> </blockquote><!-- Install --> = Configuration = <blockquo...") |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Displays cpu frequency info, and can be used as a '''governor'''<br> | |||
(see <code>cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors</code>).<br> | |||
Display and/or manages cpu frequency. | |||
= Documentation = | |||
<blockquote> | |||
{| class="wikitable" | |||
|- | |||
| github || https://github.com/torvalds/linux/tree/master/tools/power/cpupower | |||
|- | |||
|} | |||
</blockquote><!-- Documentation --> | |||
= Locations = | |||
<blockquote> | |||
{| class="wikitable" | |||
|- | |||
| <code>/etc/default/cpupower</code> || config | |||
|- | |||
|} | |||
</blockquote><!-- Locations --> | |||
= Install = | = Install = | ||
Line 7: | Line 28: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Install --> | </blockquote><!-- Install --> | ||
= Usage = | |||
<blockquote> | |||
== For Info/Settings == | |||
<blockquote> | |||
<syntaxhighlight lang="bash"> | |||
cpupower monitor # show stats | |||
cpupower frequency-info # show range/current | |||
# setting frequencies | |||
cpupower frequency-set -u 3GHz # set max clock | |||
cpupower frequency-set -d 800MHz # set min clock | |||
cpupower frequency-set -f 800MHz # set clock | |||
# governor/driver | |||
cpupower frequency-set -g ${GOVERNOR} | |||
</syntaxhighlight> | |||
</blockquote><!-- Info/Setting --> | |||
== As Governor == | |||
<blockquote> | |||
On newer intel CPUs, when which use <code>intel_pstate=enable</code> kernel param by default,<br> | |||
you cannot use <code>cpupower</code>s ondemand or conservative governors which render this service useless.<br> | |||
Arguably, your cpu knows better how to manage it's performance -- but if you're having a performance issue it may still be useful. | |||
If you'd like to use use ondemand/conservative as a governor, you'll need to modify the kernel params in your bootloader. | |||
Example | |||
<syntaxhighlight lang="conf"> | |||
# /boot/efi/loaders/entries/archlinux.conf | |||
# (systemd-boot example) | |||
options intel_pstate=disable root=PARTUUID=${partition_uuid} rw | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
systemctl enable --now cpupower.service | |||
</syntaxhighlight> | |||
</blockquote><!-- As Governor --> | |||
</blockquote><!-- Usage --> | |||
= Configuration = | = Configuration = | ||
<blockquote> | <blockquote> | ||
Configuration isn't necessary, but if you'd like to enforce min/max cpu. | |||
<syntaxhighlight lang="bash"> | |||
# /etc/default/cpupower | |||
# ondemand: dynamic scaling - max cpu, scaling down for idle | |||
# conservative: dynamic scaling - more resistant to scaling up (?) | |||
governor="ondemand" | |||
min_freq="2.25GHz" | |||
max_freq="3GHZ" | |||
# see | |||
</syntaxhighlight> | |||
</blockquote><!-- Configuration --> | </blockquote><!-- Configuration --> |
Latest revision as of 16:42, 7 March 2022
Displays cpu frequency info, and can be used as a governor
(see cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
).
Display and/or manages cpu frequency.
Documentation
github https://github.com/torvalds/linux/tree/master/tools/power/cpupower
Locations
/etc/default/cpupower
config
Install
pacman -S cpupower
Usage
For Info/Settings
cpupower monitor # show stats cpupower frequency-info # show range/current # setting frequencies cpupower frequency-set -u 3GHz # set max clock cpupower frequency-set -d 800MHz # set min clock cpupower frequency-set -f 800MHz # set clock # governor/driver cpupower frequency-set -g ${GOVERNOR}As Governor
On newer intel CPUs, when which use
intel_pstate=enable
kernel param by default,
you cannot usecpupower
s ondemand or conservative governors which render this service useless.
Arguably, your cpu knows better how to manage it's performance -- but if you're having a performance issue it may still be useful.If you'd like to use use ondemand/conservative as a governor, you'll need to modify the kernel params in your bootloader. Example
# /boot/efi/loaders/entries/archlinux.conf # (systemd-boot example) options intel_pstate=disable root=PARTUUID=${partition_uuid} rwsystemctl enable --now cpupower.service
Configuration
Configuration isn't necessary, but if you'd like to enforce min/max cpu.
# /etc/default/cpupower # ondemand: dynamic scaling - max cpu, scaling down for idle # conservative: dynamic scaling - more resistant to scaling up (?) governor="ondemand" min_freq="2.25GHz" max_freq="3GHZ" # see