xref: /dragonfly/usr.sbin/powerd/powerd.8 (revision 799ba435)
1.\" (c) Copyright 2010 by Matthew Dillon and Dima Ruban.  Permission to
2.\"    use and distribute based on the DragonFly copyright.
3.\"
4.Dd August 16, 2015
5.Dt POWERD 8
6.Os
7.Sh NAME
8.Nm powerd
9.Nd simple CPU performance control and battery life monitor
10.Sh SYNOPSIS
11.Nm
12.Op Fl cdeftQU
13.Op Fl b Ar backlight_percentage
14.Op Fl h Ar highest_freq
15.Op Fl l Ar lowest_freq
16.Op Fl p Ar hysteresis
17.Op Fl r Ar poll_time
18.Op Fl u Ar trigger_up
19.Op Fl B Ar minimum_battery_life
20.Op Fl H Ar lowtemp:hightemp
21.Op Fl L Ar battery_life_linger
22.Op Fl P Ar battery_poll_interval
23.Op Fl T Ar sample_time
24.Sh DESCRIPTION
25The
26.Nm
27daemon monitors the CPU load and automatically adjusts the CPU
28performance up or down accordingly.
29.Pp
30The
31.Nm
32also monitors battery life.
33If the battery life is low
34(less than or equal to 2% by default),
35.Nm
36will send audio alert immediately,
37and shutdown the machine after lingering for a little while
38(60 seconds by default).
39.Pp
40The options are as follows:
41.Bl -tag -width ".Fl p Ar hysteresis"
42.It Fl b Ar backlight_percentage
43Set backlight to the specified percentage,
44if AC line is not plugged in.
45.It Fl c
46Enable mwait C-state hint adjustment,
47if it is available.
48.It Fl d
49Debug option.
50Causes
51.Nm
52to not go to the background and prints some debug output to
53.Va stdout .
54.It Fl e
55Enable Intel Performance and Energy Bias Hint adjustment,
56if it is available.
57.It Fl f
58Disable CPU power domain frequency adjustment.
59CPU power domain frequency adjustment does not reduce CPU power consumption
60much
61(if any)
62on some of the modern Intel CPUs,
63when the CPU is idle.
64.It Fl h Ar highest_freq
65If CPU power domain frequency adjustment is enabled,
66then frequency of CPU power domains will not be set to a value higher
67than the specified limit (unit: MHz).
68.It Fl l Ar lowest_freq
69If CPU power domain frequency adjustment is enabled,
70then frequency of CPU power domains will not be set to a value lower
71than the specified limit (unit: MHz).
72.Pp
73NOTE: This option is ignored if powerd is in temperature management.
74Temperature management will lower the frequency in excess of this value
75if necessary (but usually doesn't have to).
76.It Fl p Ar hysteresis
77Percent of the upper limit to subtract as an hysteresis value to scale
78down to the min performance.
79The default is 10
80(meaning 10%).
81.It Fl r Ar poll_time
82Polling time in seconds.
83Default is 1.0.
84Setting this value lower will poll for load changes faster.
85For example,
86a workstation might want to use 0.2 or 0.4.
87.Nm can become unstable if you make this value too small.
88.It Fl t
89Turbo mode.
90Disables switching to turbo mode as maximum frequency completely.
91Switching to turbo mode as maximum frequency is enabled by default,
92if the CPU supports it.
93.It Fl u Ar trigger_up
94Per CPU load limit in percent to force maximum performance.
95The default is 25
96(meaning an instantanious load of 0.25 on a single cpu).
97The load is calculated over 3 polls.
98It is suggested that this value not be made lower than around 7.
99.It Fl B Ar minimum_battery_life
100If battery life is less than or equal to the specified value,
101the machine will start shutting down process.
102Default is 2
103(2% battery life left).
104.It Fl H Ar lowtemp:hightemp
105If the cpu temperature goes above lowtemp, powerd will begin ramping down
106the cpu frequency, reaching the lowest possible cpu frequency when the cpu
107temperature reaches hightemp.
108The default range is 75:85 (in degrees C), which tends to hold a laptop
109to ~80C under heavy load.
110Generally
111speaking, no machine cpu should be allowed to go above 80C even if the
112cpu can handle it, it means something is seriously wrong with your cooling
113system and you are stressing the cpu and mobo if you allow it.
114.Pp
115The default range starts at 75C.  Most desktops with reasonable cooling
116will not exceed this value so it makes for a good default.  Laptops can
117easily exceed 75C, sometimes reaching into the high 80's or even the 90's
118due to poor cooling and vendors tweaking their BIOS/fan-controls to the
119high side to do well in benchmarks.
120If you want your laptop to last, however, you really don't want it to get
121that hot.  For powerd to be able to stabilize, we recommend that a minimum
122of a 10C range be used.  So, for example, 70:80, or 75:85, and so forth.
123The user can change this range when starting powerd by adjusting
124.Va powerd_flags
125in
126.Pa /etc/rc.conf .
127.Pp
128This option can cause cpu fans to oscillate, and you may need to adjust the
129range if the oscillation is annoying to you.  The basic reason for this is
130that small changes to the cpu frequency can have a huge effect on system
131power consumption, causing the BIOS-controlled fan to react, which in turn
132also changes the temperature and causes powerd to react.
133.It Fl L Ar battery_life_linger
134If battery life is less than or equal to the configured value,
135shutting down the machine will be delayed by the specified value.
136During the delay,
137alert message will be logged to the console,
138and audio alert will be alarmed.
139If AC line is plugged in during this delay,
140shutting down process will be cancelled.
141Default is 60 seconds.
142.It Fl P Ar battery_poll_interval
143Poll the battery life at the specified interval.
144If 0 is specified,
145battery life monitoring will be disabled.
146Default is 5 seconds.
147.It Fl Q
148Don't alarm audio alert,
149if the battery life is low.
150.It Fl T Ar sample_time
151Total sample interval in seconds.
152Default is 8.0.
153This effects how quickly powerd ratchets down the performance
154and cpus on an idle machine.
155Longer times will ratchet down more slowly.
156For example,
157a workstation might want to use a value of 30.0.
158.It Fl U
159Don't adjust userland scheduler's usable CPUs.
160.El
161.Sh EXIT STATUS
162The
163.Nm
164utility will exit with a non-zero code if required sysctls are not
165present.
166If the system is unable to report temperature,
167.Nm
168will still run, but will not be able to do any temperature-based frequency
169management.
170.Pp
171If a new instance of
172.Nm
173is run from the command line, it will automatically kill any previous
174instance running in the background.
175The system operator does not have to manually kill or signal
176.Nm
177when restarting it, simply invoke a new copy.
178.Sh EXAMPLES
179The defaults work well for servers but a workstation user might want
180to use something like the following in their
181.Pa /etc/rc.conf
182to ratchet up the machine more quickly in response to spike loads
183(such as when you are browsing).
184.Pp
185.Li powerd_enable="YES"
186.Pp
187.Li powerd_flags="-u 7 -r 0.2 -T 60"
188.Sh SEE ALSO
189.Xr acpi 4 ,
190.Xr perfbias 4
191.Sh HISTORY
192The
193.Nm
194command first appeared in
195.Dx 2.7 .
196.Sh BUGS
197I'm shocked I tell you,
198shocked that there might be bugs in this program!
199