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