Cpupower

From wikinotes

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 use cpupowers 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} rw
systemctl 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