File: cpufreqd.conf.5

package info (click to toggle)
cpufreqd 2.2.1-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,012 kB
  • ctags: 578
  • sloc: sh: 8,973; ansic: 5,265; makefile: 242
file content (507 lines) | stat: -rw-r--r-- 16,047 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
.\" Copyright 2002-2005, George Staikos (staikos@0wned.org)
.\"                      Mattia Dongili (malattia@linux.it)
.\"                      Rene Rebe (rene@rocklinux.org)
.\" This file may be used subject to the terms and conditions of the
.\" GNU General Public License Version 2, or any later version
.\" at your option, as published by the Free Software Foundation.
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details."
.TH CPUFREQD.CONF 5 "05 May 2005" "" ""
.SH NAME
cpufreqd.conf \- configuration file for cpufreqd(1)
.SH DESCRIPTION
.I cpufreqd.conf
is a simple text file containing rules to be used by 
.B cpufreqd(1).

.B cpufreqd.conf
is divided into sections enclosed in tags (eg.: [General][/General]). 
You need at least one [General] section and one or more [Profile] and [Rule]
sections.  Each [Rule] depends on previously defined [Profile] subsections.
Some plugins also require a proper configuration section.

Some notes to better understand how to write appropriate rules:

.RS
\- the score of a rule is made up of the percentage of entries that match the
current system state as reported by plugins + the number of matching entries.
In this way even a single\-entry rule can reach 100% but more accurate rules
are preferred.

\- in case of 2 or more rules having the same score the first one (as found in
the configuration file) or the one already applied if applicable is kept and
set.

\- each directive is handled by a single plugin that will determine if the state
described matches the current system state.

\- if no rule matches the current system status, no action is performed.
.RE

What to keep in mind when writing rules:

.RS
\- the \-V switch is (hopefully) your friend, test your configuration slightly
increasing 
.B cpufreqd
verbosity and look what happens (\-V6 will report rules' scores, \-V7 will
report which entry matched and which not).

\- if you want a rule to be preferred over another just describe the system state
more accurately.
.RE

A good approach to write cpufreqd rules is to first describe the basic
parameters you want for a general usage (e.g.: define at least an "AC\-on" rule
and an "AC\-off" rule), then proceed and 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").

.fi
.PP
Note that no white space is allowed between name and value pairs.
Characters after a '#' are considered comments and ignored.

.SH "SECTIONS"
.PP
Acceptable configuration tokens and values include:

.PP
.SS "[General]"
.TP
.B "poll_interval"
A float larger than 0.15, measures the interval between system status reading in
seconds. Note: the lower bound has been set in order to try to avoid trashing your
system if using a too low value. (default: 1.0)

.TP
.B "enable_plugins"
A list of plugins separated by comma. As of cpufreqd 2.1.0 this option is useless,
cpufreqd will load all available plugins and remove those remaining unused
after the configuration file is read.

.TP
.B "pidfile"
Specifies the file to write as its process identification file.
(default: /var/run/cpufreqd.pid)

.TP
.B "enable_remote"
Make cpufreqd open a local UNIX socket and listen for command to be executed.
See cpufreqd-set(1) and cpufreqd-set(1) for two very simple clients.

.TP
.B "remote_group"
Make the socket readable and writeable to the specified group. Useful to allow
simple users to tweak cpufreqd with cpufreqd-set and cpufreqd-get.

.TP
.B "double_check"
Make cpufreqd check if the requested policy has been correctly applied by
re-reading the corresponding kernel attributes.

.TP
.B "verbosity"
Verbosity level from 0 (less verbose) to 7 (most verbose), the default value
only prints warning/error/critical messages. (default: 4)

.PP
.SS "[Profile]"

.TP
.B "name"
An arbitrary and unique name for your profile. [REQUIRED]

.TP
.B "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
frequency in kHz. [REQUIRED]

.TP
.B "maxfreq"
An integer value representing the maximum frequency to set. This value can be
both a percentage of the CPU full capacity or frequency in kHz. [REQUIRED]

.TP
.B "policy"
Can be any of the available governor's name as shown in
/sys/devices/.../cpufreq/scaling_available_governors, this means
that if you compiled governors as modules in your kernel, you need to load them
before running cpufreqd. [REQUIRED]

.TP
.B "other plugin entries"
Other Profile directives are available according to the enabled plugins.

.PP
.SS "[Rule]"

.TP
.B "name"
An arbitrary and unique name for your rule. [REQUIRED]

.TP
.B "profile"
A character string that must match a [Profile] section name property.
A Rule can also associate profiles to single cpus providing a list of the format
CPU%d:%s separated 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.
The "ALL" keyword has a lower priority so you can mix up CPU%d and ALL meaning that 
if no specific profile is supplied, the "ALL" one will be used. [REQUIRED]

.TP
.B "other plugin entries"
Other Rule directives are available according to the enabled plugins.

.SH PLUGINS
.PP
Plugins extend cpufreqd in order to be able to cope with the most exotic system
paramters. Currently available plugins are listed below along with the
configration directives they provide and their configuration section description
if available.

.PP
.SS "acpi plugin"
This plugin includes all the acpi monitoring functionalities previously 
available as separate plugins. It allows monitoring battery, temperature, ac
and interacting with acpid to immediately react on ACPI events.
.TP
.B "Section [acpi]"
.RS
.B "acpid_socket"
The path to 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.
.TP
.B "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).
.RE
.TP
.B "battery_interval"
The rule will have a higher score if battery percentage is between the values
provided. Can be of the form %d-%d or simply %d for a fixed value (e.g.:
battery_interval=10-100) or %s:%d-%d or %s:%d where the string represents the
battery name that must match (look at 'ls /proc/acpi/battery' for available
names).
.TP
.B "ac"
Can be on or off.  The rule will have a higher score if the A/C adapter is on or
off as defined in this setting.
.TP
.B "acpi_temperature"
The rule will have a higher score if the temperature percentage corresponds
to the provided values. Can be of the form %d-%d or simply %d for a fixed value
(e.g.: acpi_temperature=10-100) or %s:%d-%d or %s:%d where the string represents
the thermal zone name that must match (look at 'ls /proc/acpi/thermal_zone' for
available names).

.PP
.SS "apm plugin"
Monitors values reported by the APM subsystem. Available Rule entries:
.TP
.B "ac"
Can be on or off.  The rule will have a higher score if the A/C adapter is on or
off as defined in this setting.
.TP
.B "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).

.PP
.SS "pmu plugin"
Monitors values reported by the PMU subsystem. Available Rule entries:
.TP
.B "ac"
Can be on or off.  The rule will have a higher score if the A/C adapter is on or
off as defined in this setting.
.TP
.B "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).

.PP
.SS "tau plugin"
Support for the Thermal Assist Unit to read the CPU temperature from
/proc/cpuinfo.
.TP
.B "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).

.PP
.SS "cpu plugin"
Monitors the cpu usage. Available Rule entries:
.TP
.B "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-%d to 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,%f or %d:%d-%d,%f (e.g.: cpu_interval=1:70-100,1.5), default is
3, in this way niced processes will be considered 1/3 of their real value.
Rules with overlapping cpu_intervals are allowed.

.PP
.SS "exec plugin"
Executes command on Rule/Profile selection. Available Rule and Profile entries:
.TP
.B "exec_pre"
.TP
.B "exec_post"
You can give commands that you want to be executed when a Rule or Profile is
applied. As the names suggest,
.B exec_pre
will be run before a Rule or Profile is applied,
.B exec_post
will be run after.

.PP
.SS "programs plugin"
Monitors active processes. Available entries:
.TP
.B "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 program from a spe- cific location
you have to supply the full path as search pattern.

.PP
.SS "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.
.TP
.B "Section [nforce2_atxp1]"
.RS
.B "vcore_path"
Defines the interface file created by atxp1 module which will be used to change
Vcore.

.B "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.
.RE

.TP
.B "vcore"
Will set Vcore to this value (given in mV) when the corresponding Profile is
applied. Due to safety reasons range is limited from 1200 to 1850.

.PP
.SS "nvclock plugin"
Allows you to tweak the core an memory clock for NVidia cards.
The use of this plugin will allow new Profile directives.
.BI "NOTE: you MUST use this plugin ONLY with supported cards."
See also the nvclock homepage (http://www.linuxhardware.org/nvclock).

.TP
.B "nv_core"
Sets the core clock in MHz. Must be of the form %d:%d where the first integer
represents the card number, the second the desired frequency in MHz.

.TP
.B "nv_mem"
Sets the memory clock in MHz. Must be of the form %d:%d where the first integer
represents the card number, the second the desired frequency in MHz.

.PP
.SS "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.
.TP
.B "Section [sensors_plugin]"
.RS
.B "sensors_conf"
Define this directive to the sensors.conf file you want cpufreqd to use to load
the sensors library.
.RE
.TP
.B "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-%f where the string
represents the feature name and the two decimal numbers the interval into which
the directive is valid (e.g.: sensor=temp1:0-50).

.PP
.SS "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.
.TP
.B "sampling_rate"
How often the governor checks the CPU usage.  Specify in micro-seconds
or percentage of mimimum and maximum available values. Supported suffixes:
.B "`%'"
for a percentage,
.B "`s'"
for a value in seconds,
.B "`m'"
for a value in milli-seconds, or
.B "`u'"
for a value in micro-seconds (the default),
.TP
.B "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 `%'
in cpufreqd.conf for this parameter.
.TP
.BR "down_threshold" " (`conservative' governor 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 of
.B
up_threshold
(see above).
.TP
.B "sampling_down_factor"
How quickly the frequency will be decreased in respect to how quickly
it will be increased.  E.g. when set to 5, the frequency will go down
5 times `less easy' than it will go up.
.TP
.B "ignore_nice, ignore_nice_load"
Whether `nice' processes should be considered as CPU usage by the
governor.  This is a boolean value (e.g. value is either 0 or 1).
When set to 1 `nice' processes will not be counted as CPU usage by the
governor.
.B Note:
`ignore_nice' was renamed to `ignore_nice_load' in kernel version 2.6.16.
Both names are accepted in cpufreqd.conf, regardless the version of the
running kernel.
.TP
.BR "freq_step" " (`conservative' governor 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 `%' in cpufreqd.conf for this
parameter.

.SH EXAMPLE
.nf
.ne 7
# 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]
.fi

.SH SEE ALSO
.BR cpufreqd (8), cpufreqd-set (1), cpufreqd-get (1)

.SH AUTHOR
Mattia Dongili <malattia@linux.it>

George Staikos <staikos@0wned.org>