CPUFREQD.CONF(5)
๐ CPUFREQD.CONF(5) ๐
okay bestie so this is the cpufreqd.conf page from section 5 of the manual, and it's literally the whole lore on the config file for cpufreqd(1). sit down, grab a snack ๐
โจ NAME โจ
cpufreqd.conf โ it's the configuration file for cpufreqd(1). that's the whole job description, periodt.
๐ธ DESCRIPTION ๐ธ
cpufreqd.conf is a simple text file stuffed with rules that cpufreqd(1) reads and uses. no cap, that's it.
It's split into sections, and sections are wrapped in tags, like [General][/General]. The bare minimum you need is at least one [General] section plus one or more [Profile] and [Rule] sections. Heads up though: every [Rule] leans on the [Profile] subsections you defined before it, so order matters, bestie. Also some plugins want their own proper configuration section, so read the room ๐ซถ
Some notes so you can actually write rules that slap:
- a rule's score is made up of the percentage of entries that match the current system state as reported by plugins plus the number of matching entries. so yeah, even a single-entry rule can hit 100%, but rules that are more accurate get preferred ๐
- if 2 or more rules tie on score, the first one wins (first as found in the configuration file) โ or, if that's applicable, the one that's already applied gets kept and set. no drama, no switching ๐
- every single directive is handled by one plugin, and that plugin is the one deciding whether the state you described matches the current system state
- if no rule matches the current system status, then no action is performed. nothing. silence. the void ๐
What to keep in mind when you're writing rules:
- the
-Vswitch is (hopefully) your friend. test your config by slightly bumping up cpufreqd verbosity and watch what happens.-V6reports rules' scores,-V7reports which entry matched and which didn't. it's giving detective mode ๐ - if you want one rule to be preferred over another, just describe the system state more accurately. that's the whole trick, iykyk
A good approach to writing cpufreqd rules is: first, describe the basic parameters you want for general usage (e.g.: define at least an "AC-on" rule and an "AC-off" rule). then, go describe all the special cases by describing the system state more accurately (e.g.: "AC-off but running mplayer" or "AC-on but temperature too hot"). start basic, get specific, slay โจ
Note that no white space is allowed between name and value pairs. literally none. and any characters after a '#' are considered comments and get ignored ๐
๐ SECTIONS ๐
Acceptable configuration tokens and values include:
๐ [General]
poll_intervalโ a float larger than0.15, it measures the interval between system status readings, in seconds. note: that lower bound is there on purpose, to try and avoid trashing your system if you use a too-low value. (default:1.0)enable_pluginsโ a list of plugins separated by comma. as of cpufreqd2.1.0this option is useless: cpufreqd will load all available plugins and remove the ones still unused after the configuration file has been read. so like, it's giving vestigial ๐pidfileโ specifies the file to write as its process identification file. (default:/var/run/cpufreqd.pid)enable_remoteโ makes cpufreqd open a local UNIX socket and listen for a command to be executed. seecpufreqd-set(1)andcpufreqd-set(1)for two very simple clients. (and yes, it sayscpufreqd-settwice, we do not make the rules ๐ญ)remote_groupโ makes the socket readable and writeable to the specified group. useful to let simple users tweak cpufreqd withcpufreqd-setandcpufreqd-get๐ซถdouble_checkโ makes cpufreqd check whether the requested policy has actually been applied correctly, by re-reading the corresponding kernel attributes. trust but verify, bestie ๐verbosityโ verbosity level from0(less verbose) to7(most verbose). the default value only prints warning/error/critical messages. (default:4)
๐ฆ [Profile]
nameโ an arbitrary and unique name for your profile.[REQUIRED]minfreqโ an integer value representing the minimum frequency to set in/proc/cpufreq. this value can be both a percentage of the CPU full capacity or a frequency in kHz.[REQUIRED]maxfreqโ an integer value representing the maximum frequency to set. this value can be both a percentage of the CPU full capacity or a frequency in kHz.[REQUIRED]policyโ can be any of the available governor's names as shown in/sys/devices/.../cpufreq/scaling_available_governors. which means: if you compiled governors as modules in your kernel, you need to load them before running cpufreqd.[REQUIRED]- other plugin entries โ other Profile directives are available according to the enabled plugins.
๐ [Rule]
nameโ an arbitrary and unique name for your rule.[REQUIRED]profileโ a character string that must match a[Profile]section name property. a Rule can also associate profiles to single cpus by providing a list of the formatCPU%d:%sseparated by semicolons (";"), e.g.:profile=CPU0:profile0;CPU1:profile1. the keyword"ALL"can be used to indicate that all cpus must have the profile applied."ALL"has a lower priority, so you can mix upCPU%dandALLโ meaning that if no specific profile is supplied, the"ALL"one will be used.[REQUIRED]- other plugin entries โ other Rule directives are available according to the enabled plugins.
โจ PLUGINS โจ
okay bestie, plugins are how cpufreqd extends itself so it can handle even the most exotic system parameters. The currently available plugins are listed below, along with the configuration directives they provide and their configuration section description if one exists. let's get into it ๐
๐ acpi plugin ๐
This plugin includes all the acpi monitoring functionalities that used to be separate plugins. It lets you monitor battery, temperature, and ac, and it interacts with acpid so it can immediately react to ACPI events. main character energy fr fr.
๐ธ Section [acpi] ๐ธ
acpid_socketโ the path to the Acpid open socket (default:/var/run/acpid.socket). When available, cpufreqd will wake up immediately upon event arrival, and battery and ac status updates are forced. no waiting around, we love that.battery_update_intervalโ the number of seconds that have to elapse before polling the battery again. In such period the battery value will be estimated based on reported power consumption (default:30).
Rule entries for this plugin:
battery_intervalโ The rule will have a higher score if battery percentage is between the values provided. Can be of the form%d-%dor simply%dfor a fixed value (e.g.:battery_interval=10-100) or%s:%d-%dor%s:%dwhere the string represents the battery name that must match (look atls /proc/acpi/batteryfor available names).acโ Can beonoroff. The rule will have a higher score if the A/C adapter is on or off as defined in this setting.acpi_temperatureโ The rule will have a higher score if the temperature percentage corresponds to the provided values. Can be of the form%d-%dor simply%dfor a fixed value (e.g.:acpi_temperature=10-100) or%s:%d-%dor%s:%dwhere the string represents the thermal zone name that must match (look atls /proc/acpi/thermal_zonefor available names).
๐ apm plugin ๐
Monitors values reported by the APM subsystem. Available Rule entries:
acโ Can beonoroff. The rule will have a higher score if the A/C adapter is on or off as defined in this setting.battery_intervalโ The rule will have a higher score if battery percentage is between the values provided. Must be of the form%d-%d(e.g.:battery_interval=10-100).
๐ฆ pmu plugin ๐ฆ
Monitors values reported by the PMU subsystem. Available Rule entries:
acโ Can beonoroff. The rule will have a higher score if the A/C adapter is on or off as defined in this setting.battery_intervalโ The rule will have a higher score if battery percentage is between the values provided. Must be of the form%d-%d(e.g.:battery_interval=10-100).
๐ tau plugin ๐
Support for the Thermal Assist Unit to read the CPU temperature from /proc/cpuinfo.
tau_temperatureโ The rule will have a higher score if the temperature is between the values provided. Must be of the form%d-%d(e.g.:tau_temperature=30-60).
๐ฅ cpu plugin ๐ฅ
Monitors the cpu usage. Available Rule entries:
cpu_intervalโ The rule will have a higher score if cpu usage is between the values provided. Must be of the form%d-%d(e.g.:cpu_interval=10-100) or%d:%d-%dto monitor a specific cpu in SMP/SMT systems (e.g.:cpu_interval=1:50-100). Moreover you can combine multiple cpus giving multiple intervals on the same line separated by semicolon (;); if any of them matches, the full directive will match (e.g.:cpu_interval=0:50-100;1:0-60). Additionally you can use the strings"ALL"and"ANY"to request that all cpus or any cpu matches respectively (e.g.:cpu_interval=ANY:50-100). It is possible to specify the scale to calculate niced processes cpu usage with the form%d-%d,%for%d:%d-%d,%f(e.g.:cpu_interval=1:70-100,1.5), default is3, in this way niced processes will be considered1/3of their real value. Rules with overlappingcpu_intervalsare allowed.
๐ exec plugin ๐
Executes command on Rule/Profile selection. Available Rule and Profile entries:
exec_preexec_post
You can give commands that you want to be executed when a Rule or Profile is applied. As the names suggest, exec_pre will be run before a Rule or Profile is applied, exec_post will be run after.
๐ programs plugin ๐
Monitors active processes. Available entries:
programsโ The rule will have a higher score if one of the listed processes is running. This is a comma separated list. No white space is allowed between values. cpufreqd will try to match each process name with the configured process list. If you need to match against a program from a specific location you have to supply the full path as search pattern.
๐ nforce2_atxp1 plugin ๐
Allows you to change Vcore of the CPU on the fly if you own a NForce2 board with atxp1 voltage regulator (and its module loaded). The use of this plugin will allow a new Profile directive and requires a configuration section.
๐ Section [nforce2_atxp1] ๐
vcore_pathโ Defines the interface file created by atxp1 module which will be used to change Vcore.vcore_defaultโ As NForce2 boards only initialize the atxp1 on power-on, you need to put back default Vcore before reboot. This value will be used to set Vcore on exit.
Profile directive:
vcoreโ Will set Vcore to this value (given in mV) when the corresponding Profile is applied. Due to safety reasons range is limited from1200to1850.
๐ฎ nvclock plugin ๐ฎ
Allows you to tweak the core and memory clock for NVidia cards. The use of this plugin will allow new Profile directives.
NOTE: you MUST use this plugin ONLY with supported cards. See also the nvclock homepage (http://www.linuxhardware.org/nvclock).
nv_coreโ Sets the core clock in MHz. Must be of the form%d:%dwhere the first integer represents the card number, the second the desired frequency in MHz.nv_memโ Sets the memory clock in MHz. Must be of the form%d:%dwhere the first integer represents the card number, the second the desired frequency in MHz.
๐ก๏ธ sensors plugin ๐ก๏ธ
Allows you to specify lm-sensors features to watch, see sensors -u to find out which sensors are available on your system. A configuration section is also available to tell cpufreqd which sensors.conf file to use. If not specified it will take the first on the default locations.
๐ฆ Section [sensors_plugin] ๐ฆ
sensors_confโ Define this directive to thesensors.conffile you want cpufreqd to use to load the sensors library.
Rule entry:
sensorโ The rule will have a higher score if the given sensor feature reports a value between the two defined. Must be of the form%s:%f-%fwhere the string represents the feature name or label and the two decimal numbers the interval into which the directive is valid (e.g.:sensor=temp1:0-50).
โ๏ธ governor_parameters plugin โ๏ธ
Allows you to specify parameters for governors in [Profile] sections. Currently only the ondemand and conservative governors support parameters. The description of the parameters below is basically a summary of the information found in the file governors.txt in the documentation of kernel versions 2.6.16 or later.
sampling_rateโ How often the governor checks the CPU usage. Specify in micro-seconds or percentage of mimimum and maximum available values. Supported suffixes:%for a percentage,sfor a value in seconds,mfor a value in milli-seconds, orufor a value in micro-seconds (the default).up_thresholdโ What the average CPU usage needs be at least to make the governor decide to switch to a higher frequency. Though the value is interpreted as percentage by the governor, you should not append a%incpufreqd.conffor this parameter.down_threshold(conservativegovernor only) โ What the average CPU usage needs be at most to make the governor decide to switch to a lower frequency. This is the opposite ofup_threshold(see above).sampling_down_factorโ How quickly the frequency will be decreased in respect to how quickly it will be increased. E.g. when set to5, the frequency will go down5timesless easythan it will go up.ignore_nice,ignore_nice_loadโ Whetherniceprocesses should be considered as CPU usage by the governor. This is a boolean value (e.g. value is either0or1). When set to1niceprocesses will not be counted as CPU usage by the governor. Note:ignore_nicewas renamed toignore_nice_loadin kernel version2.6.16. Both names are accepted incpufreqd.conf, regardless the version of the running kernel.freq_step(conservativegovernor only) โ How much the frequency should be changed (up or down) each time the governor decides the frequency should go up or down. The value is the percentage of the maximum available frequency you want the frequency to increase or decrease each time. The actual frequency your CPU runs at will only change when the desired frequency reaches the next available frequency. Though the value is interpreted as percentage by the governor, you should not append a%incpufreqd.conffor this parameter.
โจ EXAMPLE โจ
okay bestie, here's a whole entire config file that actually works, so you can stop guessing and just vibe with it ๐ every line matters, so read the comments, they're literally the lore.
# cpufreqd.conf sample
# this is a comment
[General]
pidfile=/var/run/cpufreqd.pid
poll_interval=2
verbosity=5 #(if you want a minimal logging)
[/General]
[Profile]
name=hi
minfreq=100%
maxfreq=100%
policy=performance
[/Profile]
[Profile]
name=medium
minfreq=66%
maxfreq=66%
policy=performance
[/Profile]
[Profile]
name=lo
minfreq=33%
maxfreq=33%
policy=performance
[/Profile]
[Profile]
name=ondemand_hi
minfreq=0%
maxfreq=100%
policy=ondemand
[/Profile]
[Profile]
name=ondemand_lo
minfreq=0%
maxfreq=66%
policy=ondemand
ignore_nice=1
sampling_rate=80%
[/Profile]
# full power when AC
# max score 101%
[Rule]
name=AC_on
ac=on
profile=hi
[/Rule]
# conservative mode when not AC
# max score 101%
[Rule]
name=AC_off
ac=off
profile=ondemand_hi
[/Rule]
# low battery
# max score 102%
[Rule]
name=lo_battery
ac=off
battery_interval=0-40
profile=ondemand_lo
[/Rule]
# need big power (not if battery very low)
# max score 103%
[Rule]
name=hi_cpu
ac=off
battery_interval=40-100
cpu_interval=ANY:70-100
profile=hi
[/Rule]
# slow down a little if overheated
# max score 103%
[Rule]
name=overheat
acpi_temperature=55-100
cpu_interval=ANY:0-100
battery_interval=40-100
profile=medium
[/Rule]
# full power when watching DVDs and not AC
# can reach a 105% score
[Rule]
name=dvd_watching
ac=off
battery_interval=0-100
acpi_temperature=0-100
cpu_interval=ANY:0-100
programs=xine,mplayer
profile=hi
[/Rule]
like, look at it ๐
the <pink>[Profile]</pink> blocks are your moods โ hi is full main character energy at 100%, medium is chillin at 66%, lo is napping at 33%, and the two ondemand ones let the kernel do its own thing between 0% and their maxfreq ๐ธ
then the <purple>[Rule]</purple> blocks are the vibe check โ whichever rule scores highest gets to pick the profile, and yes, those # max score comments in there are fr fr doing math for you ๐ญ
not me pointing out thatdvd_watchingcan hit a105%score and just take over โ the numbers are all right there in the comments bestie, i don't make the rules, i just explain them ๐ซถ
๐ SEE ALSO ๐
cpufreqd(8), cpufreqd-set(1), cpufreqd-get(1)
like go read the friends, they're all part of the same little family ๐
๐ AUTHOR ๐
Mattia Dongili <malattia@linux.it>
George Staikos <staikos@0wned.org>
absolute icons, both of them, no cap ๐
okay that's the whole page bestie, you're officially a <hotpink>cpufreqd.conf</hotpink> girlie now ๐ go forth and tune your CPU, this is <cyan>CPUFREQD.CONF(5)</cyan> from <yellow>05 May 2005</yellow> and it ate, periodt โจ๐๐ฆ
๐ฆ where this page comes from
- alpine 3.24: cpufreqd-doc 2.4.2-r9 ยท GPL-2.0-or-later
- debian bookworm: cpufreqd 2.4.2-3
- ubuntu jammy: cpufreqd 2.4.2-2ubuntu3
- Copyright 2002-2005, George Staikos (staikos@0wned.org)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms