xref: /dragonfly/usr.sbin/powerd/powerd.8 (revision 655933d6)
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.Pp
77NOTE: If you are using a serial port at 115200 baud, it is recommended
78you not allow the frequency to drop below 1500 Mhz or you might lose
79characters.
80.It Fl p Ar hysteresis
81Percent of the upper limit to subtract as an hysteresis value to scale
82down to the min performance.
83The default is 10
84(meaning 10%).
85.It Fl r Ar poll_time
86Polling time in seconds.
87Default is 1.0.
88Setting this value lower will poll for load changes faster.
89For example,
90a workstation might want to use 0.2 or 0.4.
91.Nm
92can become unstable if you make this value too small.
93.It Fl t
94Turbo mode.
95Disables switching to turbo mode as maximum frequency completely.
96Switching to turbo mode as maximum frequency is enabled by default,
97if the CPU supports it.
98.It Fl u Ar trigger_up
99Per CPU load limit in percent to force maximum performance.
100The default is 25
101(meaning an instantanious load of 0.25 on a single cpu).
102The load is calculated over 3 polls.
103It is suggested that this value not be made lower than around 7.
104.It Fl B Ar minimum_battery_life
105If battery life is less than or equal to the specified value,
106the machine will start shutting down process.
107Default is 2
108(2% battery life left).
109.It Fl H Ar lowtemp:hightemp
110If the cpu temperature goes above lowtemp, powerd will begin ramping down
111the cpu frequency, reaching the lowest possible cpu frequency when the cpu
112temperature reaches hightemp.
113The default range is 75:85 (in degrees C), which tends to hold a laptop
114to ~80C under heavy load.
115Generally
116speaking, no machine cpu should be allowed to go above 80C even if the
117cpu can handle it, it means something is seriously wrong with your cooling
118system and you are stressing the cpu and mobo if you allow it.
119.Pp
120The default range starts at 75C.  Most desktops with reasonable cooling
121will not exceed this value so it makes for a good default.  Laptops can
122easily exceed 75C, sometimes reaching into the high 80's or even the 90's
123due to poor cooling and vendors tweaking their BIOS/fan-controls to the
124high side to do well in benchmarks.
125If you want your laptop to last, however, you really don't want it to get
126that hot.  For powerd to be able to stabilize, we recommend that a minimum
127of a 10C range be used.  So, for example, 70:80, or 75:85, and so forth.
128The user can change this range when starting powerd by adjusting
129.Va powerd_flags
130in
131.Pa /etc/rc.conf .
132.Pp
133This option can cause cpu fans to oscillate, and you may need to adjust the
134range if the oscillation is annoying to you.  The basic reason for this is
135that small changes to the cpu frequency can have a huge effect on system
136power consumption, causing the BIOS-controlled fan to react, which in turn
137also changes the temperature and causes powerd to react.
138.It Fl L Ar battery_life_linger
139If battery life is less than or equal to the configured value,
140shutting down the machine will be delayed by the specified value.
141During the delay,
142alert message will be logged to the console,
143and audio alert will be alarmed.
144If AC line is plugged in during this delay,
145shutting down process will be cancelled.
146Default is 60 seconds.
147.It Fl P Ar battery_poll_interval
148Poll the battery life at the specified interval.
149If 0 is specified,
150battery life monitoring will be disabled.
151Default is 5 seconds.
152.It Fl Q
153Don't alarm audio alert,
154if the battery life is low.
155.It Fl T Ar sample_time
156Total sample interval in seconds.
157Default is 8.0.
158This effects how quickly powerd ratchets down the performance
159and cpus on an idle machine.
160Longer times will ratchet down more slowly.
161For example,
162a workstation might want to use a value of 30.0.
163.It Fl U
164Don't adjust userland scheduler's usable CPUs.
165.El
166.Sh EXIT STATUS
167The
168.Nm
169utility will exit with a non-zero code if required sysctls are not
170present.
171If the system is unable to report temperature,
172.Nm
173will still run, but will not be able to do any temperature-based frequency
174management.
175.Pp
176If a new instance of
177.Nm
178is run from the command line, it will automatically kill any previous
179instance running in the background.
180The system operator does not have to manually kill or signal
181.Nm
182when restarting it, simply invoke a new copy.
183.Sh EXAMPLES
184The defaults work well for servers but a workstation user might want
185to use something like the following in their
186.Pa /etc/rc.conf
187to ratchet up the machine more quickly in response to spike loads
188(such as when you are browsing).
189.Pp
190.Li powerd_enable="YES"
191.Pp
192.Li powerd_flags="-u 7 -r 0.2 -T 60"
193.Sh SEE ALSO
194.Xr acpi 4 ,
195.Xr perfbias 4
196.Sh HISTORY
197The
198.Nm
199command first appeared in
200.Dx 2.7 .
201.Sh BUGS
202I'm shocked I tell you,
203shocked that there might be bugs in this program!
204