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