| @@ -1,247 +1,247 @@ | | | @@ -1,247 +1,247 @@ |
1 | .\" $NetBSD: acpicpu.4,v 1.3 2010/08/09 06:40:33 jruoho Exp $ | | 1 | .\" $NetBSD: acpicpu.4,v 1.4 2010/08/09 10:57:23 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Coyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> | | 3 | .\" Coyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Neither the name of the author nor the names of any | | 11 | .\" 2. Neither the name of the author nor the names of any |
12 | .\" contributors may be used to endorse or promote products derived | | 12 | .\" contributors may be used to endorse or promote products derived |
13 | .\" from this software without specific prior written permission. | | 13 | .\" from this software without specific prior written permission. |
14 | .\" | | 14 | .\" |
15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS | | 15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS |
16 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 16 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
17 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 17 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
18 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 18 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
19 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 19 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
20 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 20 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
21 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 21 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
22 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 22 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
23 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 23 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
24 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 24 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
25 | .\" POSSIBILITY OF SUCH DAMAGE. | | 25 | .\" POSSIBILITY OF SUCH DAMAGE. |
26 | .\" | | 26 | .\" |
27 | .Dd August 9, 2010 | | 27 | .Dd August 9, 2010 |
28 | .Dt ACPICPU 4 | | 28 | .Dt ACPICPU 4 |
29 | .Os | | 29 | .Os |
30 | .Sh NAME | | 30 | .Sh NAME |
31 | .Nm acpicpu | | 31 | .Nm acpicpu |
32 | .Nd ACPI CPU | | 32 | .Nd ACPI CPU |
33 | .Sh SYNOPSIS | | 33 | .Sh SYNOPSIS |
34 | .Cd "acpicpu* at acpi?" | | 34 | .Cd "acpicpu* at acpi?" |
35 | .Sh DESCRIPTION | | 35 | .Sh DESCRIPTION |
36 | The | | 36 | The |
37 | .Nm | | 37 | .Nm |
38 | device driver supports certain processor features that are | | 38 | device driver supports certain processor features that are |
39 | either only available via | | 39 | either only available via |
40 | .Tn ACPI | | 40 | .Tn ACPI |
41 | or that require | | 41 | or that require |
42 | .Tn ACPI | | 42 | .Tn ACPI |
43 | to function properly. | | 43 | to function properly. |
44 | Typically the | | 44 | Typically the |
45 | .Tn ACPI | | 45 | .Tn ACPI |
46 | processor functionality is grouped into so-called C, P, and T -states. | | 46 | processor functionality is grouped into so-called C-, P-, and T-states. |
47 | Presently, | | 47 | Presently, |
48 | .Nm | | 48 | .Nm |
49 | supports C and P -states. | | 49 | supports C- and P-states. |
50 | .Ss C-states | | 50 | .Ss C-states |
51 | The processor power states, or C-states, | | 51 | The processor power states, or C-states, |
52 | are low-power modes that can be used when the | | 52 | are low-power modes that can be used when the |
53 | .Tn CPU | | 53 | .Tn CPU |
54 | is idle. | | 54 | is idle. |
55 | The idea is not new: already in the | | 55 | The idea is not new: already in the |
56 | .Tn 80486 | | 56 | .Tn 80486 |
57 | processor a specific instruction | | 57 | processor a specific instruction |
58 | .Pq Tn HLT | | 58 | .Pq Tn HLT |
59 | was used for this purpose. | | 59 | was used for this purpose. |
60 | This was later accompanied by a pair of other instructions | | 60 | This was later accompanied by a pair of other instructions |
61 | .Pq Tn MONITOR , MWAIT . | | 61 | .Pq Tn MONITOR , MWAIT . |
62 | By default, | | 62 | By default, |
63 | .Nx | | 63 | .Nx |
64 | may use either one; see the | | 64 | may use either one; see the |
65 | .Ic machdep.idle-mechanism | | 65 | .Ic machdep.idle-mechanism |
66 | .Xr sysctl 8 | | 66 | .Xr sysctl 8 |
67 | variable. | | 67 | variable. |
68 | .Tn ACPI | | 68 | .Tn ACPI |
69 | provides the latest amendment. | | 69 | provides the latest amendment. |
70 | .Pp | | 70 | .Pp |
71 | The following C-states are typically available. | | 71 | The following C-states are typically available. |
72 | Additional processor or vendor specific | | 72 | Additional processor or vendor specific |
73 | states (C4, ..., Cn) are handled internally by | | 73 | states (C4, ..., Cn) are handled internally by |
74 | .Nm . | | 74 | .Nm . |
75 | .Pp | | 75 | .Pp |
76 | .Bl -tag -width C1 -offset indent | | 76 | .Bl -tag -width C1 -offset indent |
77 | .It Dv C0 | | 77 | .It Dv C0 |
78 | This is the normal state of a processor; the | | 78 | This is the normal state of a processor; the |
79 | .Tn CPU | | 79 | .Tn CPU |
80 | is busy executing instructions. | | 80 | is busy executing instructions. |
81 | .It Dv C1 | | 81 | .It Dv C1 |
82 | This is the state that is typically reached via the mentioned | | 82 | This is the state that is typically reached via the mentioned |
83 | .Tn x86 | | 83 | .Tn x86 |
84 | instructions. | | 84 | instructions. |
85 | On a typical processor, | | 85 | On a typical processor, |
86 | .Dv C1 | | 86 | .Dv C1 |
87 | turns off the main internal | | 87 | turns off the main internal |
88 | .Tn CPU | | 88 | .Tn CPU |
89 | clock, leaving | | 89 | clock, leaving |
90 | .Tn APIC | | 90 | .Tn APIC |
91 | running at full speed. | | 91 | running at full speed. |
92 | The | | 92 | The |
93 | .Tn CPU | | 93 | .Tn CPU |
94 | is free to temporarily leave the state to deal with important requests. | | 94 | is free to temporarily leave the state to deal with important requests. |
95 | .It Dv C2 | | 95 | .It Dv C2 |
96 | The main difference between | | 96 | The main difference between |
97 | .Dv C1 | | 97 | .Dv C1 |
98 | and | | 98 | and |
99 | .Dv C2 | | 99 | .Dv C2 |
100 | lies in the internal hardware entry method of the processor. | | 100 | lies in the internal hardware entry method of the processor. |
101 | While less power is expected to be consumed than in | | 101 | While less power is expected to be consumed than in |
102 | .Dv C1 , | | 102 | .Dv C1 , |
103 | the bus interface unit is still running. | | 103 | the bus interface unit is still running. |
104 | But depending on the processor, the local | | 104 | But depending on the processor, the local |
105 | .Tn APIC | | 105 | .Tn APIC |
106 | timer may be stopped. | | 106 | timer may be stopped. |
107 | Like with | | 107 | Like with |
108 | .Dv C1 , | | 108 | .Dv C1 , |
109 | entering and exiting the state are expected to be fast operations. | | 109 | entering and exiting the state are expected to be fast operations. |
110 | .It Dv C3 | | 110 | .It Dv C3 |
111 | This is the deepest conventional state. | | 111 | This is the deepest conventional state. |
112 | Parts of the | | 112 | Parts of the |
113 | .Tn CPU | | 113 | .Tn CPU |
114 | are actively powered down. | | 114 | are actively powered down. |
115 | The internal | | 115 | The internal |
116 | .Tn CPU | | 116 | .Tn CPU |
117 | clock is stopped. | | 117 | clock is stopped. |
118 | The local | | 118 | The local |
119 | .Tn APIC | | 119 | .Tn APIC |
120 | timer is stopped. | | 120 | timer is stopped. |
121 | Depending on the processor, additional timers such as | | 121 | Depending on the processor, additional timers such as |
122 | .Tn TSC | | 122 | .Tn TSC |
123 | .Pq time stamp counter | | 123 | .Pq time stamp counter |
124 | may be stopped. | | 124 | may be stopped. |
125 | Entry and exit latencies are expected to be high; the | | 125 | Entry and exit latencies are expected to be high; the |
126 | .Tn CPU | | 126 | .Tn CPU |
127 | can no longer | | 127 | can no longer |
128 | .Dq quickly | | 128 | .Dq quickly |
129 | respond to bus activity or other interruptions. | | 129 | respond to bus activity or other interruptions. |
130 | .El | | 130 | .El |
131 | .Pp | | 131 | .Pp |
132 | Each state has a latency associated with entry and exit. | | 132 | Each state has a latency associated with entry and exit. |
133 | The higher the state, the lower the power consumption, and | | 133 | The higher the state, the lower the power consumption, and |
134 | the higher the potential performance costs. | | 134 | the higher the potential performance costs. |
135 | .Pp | | 135 | .Pp |
136 | The | | 136 | The |
137 | .Nm | | 137 | .Nm |
138 | driver tries to balance the latency | | 138 | driver tries to balance the latency |
139 | constraints when choosing the appropriate state. | | 139 | constraints when choosing the appropriate state. |
140 | One of the checks involves bus master activity; | | 140 | One of the checks involves bus master activity; |
141 | if such activity is detected, a lower state is used. | | 141 | if such activity is detected, a lower state is used. |
142 | It is known that particularly | | 142 | It is known that particularly |
143 | .Xr usb 4 | | 143 | .Xr usb 4 |
144 | may cause high activity even when not in use. | | 144 | may cause high activity even when not in use. |
145 | If maximum power savings are desirable, | | 145 | If maximum power savings are desirable, |
146 | it may be necessary to use a custom kernel without | | 146 | it may be necessary to use a custom kernel without |
147 | .Tn USB | | 147 | .Tn USB |
148 | support. | | 148 | support. |
149 | And generally: to save power with C-states, one should | | 149 | And generally: to save power with C-states, one should |
150 | avoid polling, both in userland and in the kernel. | | 150 | avoid polling, both in userland and in the kernel. |
151 | .Ss P-states | | 151 | .Ss P-states |
152 | The processor performance states, or P-states, are used to | | 152 | The processor performance states, or P-states, are used to |
153 | control the clock frequencies and voltages of a | | 153 | control the clock frequencies and voltages of a |
154 | .Tn CPU . | | 154 | .Tn CPU . |
155 | Underneath the abstractions of | | 155 | Underneath the abstractions of |
156 | .Tn ACPI , | | 156 | .Tn ACPI , |
157 | P-states are associated with such technologies as | | 157 | P-states are associated with such technologies as |
158 | .Dq SpeedStep | | 158 | .Dq SpeedStep |
159 | .Pq Intel , | | 159 | .Pq Intel , |
160 | .Dq PowerNow! | | 160 | .Dq PowerNow! |
161 | .Pq Tn AMD , | | 161 | .Pq Tn AMD , |
162 | and | | 162 | and |
163 | .Dq PowerSaver | | 163 | .Dq PowerSaver |
164 | .Pq VIA . | | 164 | .Pq VIA . |
165 | .Pp | | 165 | .Pp |
166 | The | | 166 | The |
167 | .Dv P0 | | 167 | .Dv P0 |
168 | state is always the highest operating frequency sypported by the processor. | | 168 | state is always the highest operating frequency sypported by the processor. |
169 | The number of additional P-states may vary across processors and vendors. | | 169 | The number of additional P-states may vary across processors and vendors. |
170 | Each higher numbered P-state represents lower | | 170 | Each higher numbered P-state represents lower |
171 | clock frequencies and hence lower power consumption. | | 171 | clock frequencies and hence lower power consumption. |
172 | .Pp | | 172 | .Pp |
173 | Unlike conventional | | 173 | Unlike conventional |
174 | .Tn CPU | | 174 | .Tn CPU |
175 | frequency management, | | 175 | frequency management, |
176 | .Tn ACPI | | 176 | .Tn ACPI |
177 | provides support for Dynamic Frequency and Voltage Scaling | | 177 | provides support for Dynamic Frequency and Voltage Scaling |
178 | .Pq Tn DVFS . | | 178 | .Pq Tn DVFS . |
179 | This means that the firmware may request the implementation to | | 179 | This means that the firmware may request the implementation to |
180 | dynamically scale the presently supported maximum clock frequency. | | 180 | dynamically scale the presently supported maximum clock frequency. |
181 | For example, if | | 181 | For example, if |
182 | .Xr acpiacad 4 | | 182 | .Xr acpiacad 4 |
183 | is disconnected, the maximum available frequency may be lowered. | | 183 | is disconnected, the maximum available frequency may be lowered. |
184 | Currently the | | 184 | Currently the |
185 | .Nx | | 185 | .Nx |
186 | implementation reacts to these events by imposing the dynamic maximum, but | | 186 | implementation reacts to these events by imposing the dynamic maximum, but |
187 | .Nm | | 187 | .Nm |
188 | does not take any actions to manipulate the frequencies by itself. | | 188 | does not take any actions to manipulate the frequencies by itself. |
189 | .Sh SEE ALSO | | 189 | .Sh SEE ALSO |
190 | .Xr acpi 4 , | | 190 | .Xr acpi 4 , |
191 | .Xr cpu_idle 9 | | 191 | .Xr cpu_idle 9 |
192 | .Sh HISTORY | | 192 | .Sh HISTORY |
193 | The | | 193 | The |
194 | .Nm | | 194 | .Nm |
195 | device driver appeared in | | 195 | device driver appeared in |
196 | .Nx 6.0 . | | 196 | .Nx 6.0 . |
197 | .Sh AUTHORS | | 197 | .Sh AUTHORS |
198 | .An Jukka Ruohonen | | 198 | .An Jukka Ruohonen |
199 | .Aq jruohonen@iki.fi | | 199 | .Aq jruohonen@iki.fi |
200 | .Sh CAVEATS | | 200 | .Sh CAVEATS |
201 | The | | 201 | The |
202 | .Nm | | 202 | .Nm |
203 | driver should be considered experimental. | | 203 | driver should be considered experimental. |
204 | At least the following caveats can be mentioned. | | 204 | At least the following caveats can be mentioned. |
205 | .Bl -bullet | | 205 | .Bl -bullet |
206 | .It | | 206 | .It |
207 | It is currently only safe to use | | 207 | It is currently only safe to use |
208 | .Dv C1 | | 208 | .Dv C1 |
209 | on | | 209 | on |
210 | .Nx . | | 210 | .Nx . |
211 | All other C-states are disabled by default. | | 211 | All other C-states are disabled by default. |
212 | .It | | 212 | .It |
213 | The | | 213 | The |
214 | .Tn AMD | | 214 | .Tn AMD |
215 | .Tn C1E | | 215 | .Tn C1E |
216 | extension is not supported. | | 216 | extension is not supported. |
217 | If this extension is available in a vendor | | 217 | If this extension is available in a vendor |
218 | .Tn BIOS , | | 218 | .Tn BIOS , |
219 | it is recommended to turn it off, with or without | | 219 | it is recommended to turn it off, with or without |
220 | .Nm . | | 220 | .Nm . |
221 | .It | | 221 | .It |
222 | The use of native instructions in P-states | | 222 | The use of native instructions in P-states |
223 | is currently supported only on Intel | | 223 | is currently supported only on Intel |
224 | .Tn CPUs . | | 224 | .Tn CPUs . |
225 | .It | | 225 | .It |
226 | Neither processor thermal control (see | | 226 | Neither processor thermal control (see |
227 | .Xr acpitz 4 ) | | 227 | .Xr acpitz 4 ) |
228 | nor | | 228 | nor |
229 | .Dq throttling | | 229 | .Dq throttling |
230 | are currently supported. | | 230 | are currently supported. |
231 | .It | | 231 | .It |
232 | There is currently neither a well-defined, machine-independent | | 232 | There is currently neither a well-defined, machine-independent |
233 | .Tn API | | 233 | .Tn API |
234 | for processor performance management nor a | | 234 | for processor performance management nor a |
235 | .Dq governor | | 235 | .Dq governor |
236 | for different policies. | | 236 | for different policies. |
237 | It is only possible to control the | | 237 | It is only possible to control the |
238 | .Tn CPU | | 238 | .Tn CPU |
239 | frequencies from userland. | | 239 | frequencies from userland. |
240 | .It | | 240 | .It |
241 | There are currently no proper ways to export | | 241 | There are currently no proper ways to export |
242 | statistical and other information from | | 242 | statistical and other information from |
243 | .Nm . | | 243 | .Nm . |
244 | This applies to | | 244 | This applies to |
245 | .Tn ACPI | | 245 | .Tn ACPI |
246 | generally. | | 246 | generally. |
247 | .El | | 247 | .El |