1. Home
  2. Docs
  3. Hardware and Network
  4. CPU Frequency Scaling

CPU Frequency Scaling

thermald

is a Linux daemon used to prevent the overheating of platforms. This daemon monitors temperature and applies compensation using available cooling methods.

By default, it monitors CPU temperature using available CPU digital temperature sensors and maintains CPU temperature under control, before HW takes aggressive correction action. If there is a skin temperature sensor in thermal sysfs, then it tries to keep skin temperature under 45C.

Source: https://wiki.archlinux.org

install needed:

yay -S --needed thermald
sudo nano /usr/lib/systemd/system/thermald.service

change the line:

ExecStart=/usr/bin/thermald --no-daemon --dbus-enable

like so:

ExecStart=/usr/bin/thermald --no-daemon --dbus-enable --ignore-cpuid-check

services e.t.c.:

sudo systemctl enable thermald

reboot

cpupower

is a set of userspace utilities designed to assist with CPU frequency scaling.

full list of available modules:

sudo ls /usr/lib/modules/$(uname -r)/kernel/drivers/cpufreq/ 

Load the appropriate module (see Kernel modules for details). Once the appropriate cpufreq driver is loaded, detailed information about the CPU(s) can be displayed by running

sudo cpupower frequency-info 

Scaling governors

Governors (see table below) are power schemes for the CPU. Only one may be active at a time. For details, see the kernel documentation in the kernel source.

Governor Description
performanceRun the CPU at the maximum frequency.
powersaveRun the CPU at the minimum frequency.
userspaceRun the CPU at user specified frequencies.
ondemandScales the frequency dynamically according to current load. Jumps to the highest frequency and then possibly back off as the idle time increases.
conservativeScales the frequency dynamically according to current load. Scales the frequency more gradually than ondemand.
schedutil
………………………..
Scheduler-driven CPU frequency selection [1][2].

set one for all cores:
(replace governor with e.g. what you want ondemand p.e…)

sudo echo *governor* > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

see live output:

watch grep \"cpu MHz\" /proc/cpuinfo

making one permanent:

sudo systemctl enable cpupower.service

and configure it to use what you want per default:

inside /etc/default/cpupower

# Define CPUs governor
# valid governors: ondemand, performance, powersave, conservative, userspace.
governor='ondemand'

# Limit frequency range
# Valid suffixes: Hz, kHz (default), MHz, GHz, THz
#min_freq="2.25GHz"
#max_freq="3GHz"

# Specific frequency to be set.
# Requires userspace governor to be available.
# Do not set governor field if you use this one.
#freq=

# Utilizes cores in one processor package/socket first before processes are 
# scheduled to other processor packages/sockets.
# See man (1) CPUPOWER-SET for additional details.
#mc_scheduler=

# Utilizes thread siblings of one processor core first before processes are
# scheduled to other cores. See man (1) CPUPOWER-SET for additional details.
#smp_scheduler=

#  Sets a register on supported Intel processore which allows software to convey
# its policy for the relative importance of performance versus energy savings to
# the  processor. See man (1) CPUPOWER-SET for additional details.
#perf_bias=

# vim:set ts=2 sw=2 ft=sh et:
Follow us
Was this article helpful to you? Yes No

How can we help?