cpupower - CPU Frequency & Governor Control Cheatsheet
cpupower inspects and controls the Linux kernel’s CPU frequency scaling (cpufreq) and idle-state (cpuidle) subsystems. It shows what speed each core is running at, lets you switch the scaling governor (e.g. performance for max speed, powersave for efficiency), pin or bound frequencies, and inspect/disable deep C-states that add wake-up latency. It is the standard tool for squeezing predictable performance out of a machine or saving power on a laptop.
Installation
| Platform | Command |
|---|
| Debian/Ubuntu | sudo apt install linux-cpupower |
| Fedora/RHEL | sudo dnf install kernel-tools |
| Arch Linux | sudo pacman -S cpupower |
| Verify | cpupower --version |
Inspecting State
| Command | Shows |
|---|
cpupower frequency-info | Governor, current/min/max freq, driver |
cpupower -c all frequency-info | Info for all cores |
cpupower idle-info | Available C-states and usage |
cpupower monitor | Live per-core frequency/idle residency |
watch -n1 'cpupower -c all frequency-info -f' | Live frequencies |
# Quick look at the governor and current speed
cpupower frequency-info
Governors
| Governor | Behavior |
|---|
performance | Always run at max frequency |
powersave | Prefer lowest frequency (or intel_pstate min) |
ondemand | Scale up quickly under load |
conservative | Scale up gradually |
schedutil | Scheduler-driven scaling (modern default) |
userspace | Frequency set manually |
# See available governors
cpupower frequency-info -g
# Set the performance governor on all cores
sudo cpupower frequency-set -g performance
Setting Frequency
| Command | Effect |
|---|
sudo cpupower frequency-set -g performance | Set governor |
sudo cpupower frequency-set -d 2.0GHz | Set minimum frequency |
sudo cpupower frequency-set -u 3.5GHz | Set maximum frequency |
sudo cpupower frequency-set -f 3.0GHz | Pin a fixed frequency (userspace gov) |
sudo cpupower -c 0-3 frequency-set -g powersave | Per-core governor |
Idle States (C-states)
Deep C-states save power but add wake-up latency — a problem for latency-sensitive workloads.
| Command | Effect |
|---|
cpupower idle-info | List C-states and residency |
sudo cpupower idle-set -d 3 | Disable a specific C-state |
sudo cpupower idle-set -e 3 | Enable a C-state |
sudo cpupower idle-set -D 10 | Disable C-states with latency > 10µs |
# Latency-critical: disable deep idle states for consistent wake-ups
sudo cpupower idle-set -D 5
Monitoring Under Load
# Watch how frequency and idle residency respond to a workload
cpupower monitor -i 1
Shows per-core frequency and time spent in each C-state — useful to confirm a governor change actually took effect.
Making Changes Persist
cpupower frequency-set is not persistent across reboots. Options:
| Method | How |
|---|
| systemd service | systemctl enable cpupower with /etc/default/cpupower |
/etc/default/cpupower | Set GOVERNOR="performance" |
| TuneD | Let tuned manage the governor via a profile |
| rc.local / unit | Run the frequency-set command at boot |
Common Workflows
# Benchmark box: lock to performance for reproducible numbers
sudo cpupower frequency-set -g performance
cpupower frequency-info -f -c all # verify
# Laptop: save battery
sudo cpupower frequency-set -g powersave
# Latency tuning: performance governor + shallow idle
sudo cpupower frequency-set -g performance
sudo cpupower idle-set -D 5
| Tool | Role |
|---|
| cpupower | CPU frequency/governor + idle-state control |
| tuned | Whole-system profiles (sets governor + more) |
| numactl | NUMA CPU/memory binding |
taskset | CPU affinity for a process |
turbostat | Detailed per-core freq/power telemetry |
For a coherent whole-system approach, let tuned manage governors; use cpupower for direct, per-core control and inspection.
Resources