| @@ -1,312 +1,312 @@ | | | @@ -1,312 +1,312 @@ |
1 | .\" $NetBSD: KERNEL_LOCK.9,v 1.1 2022/02/15 22:46:29 riastradh Exp $ | | 1 | .\" $NetBSD: KERNEL_LOCK.9,v 1.2 2022/02/15 22:58:25 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2022 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2022 The NetBSD Foundation, Inc. |
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. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" | | 14 | .\" |
15 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 15 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 February 13, 2022 | | 27 | .Dd February 13, 2022 |
28 | .Dt KERNEL_LOCK 9 | | 28 | .Dt KERNEL_LOCK 9 |
29 | .Os | | 29 | .Os |
30 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | | 30 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
31 | .Sh NAME | | 31 | .Sh NAME |
32 | .Nm KERNEL_LOCK | | 32 | .Nm KERNEL_LOCK |
33 | .Nd compatibility with legacy uniprocessor code | | 33 | .Nd compatibility with legacy uniprocessor code |
34 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | | 34 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
35 | .Sh SYNOPSIS | | 35 | .Sh SYNOPSIS |
36 | .In sys/systm.h | | 36 | .In sys/systm.h |
37 | .\" | | 37 | .\" |
38 | .Ft void | | 38 | .Ft void |
39 | .Fn KERNEL_LOCK "int nlocks" "struct lwp *l" | | 39 | .Fn KERNEL_LOCK "int nlocks" "struct lwp *l" |
40 | .Ft void | | 40 | .Ft void |
41 | .Fn KERNEL_UNLOCK_ONE "struct lwp *l" | | 41 | .Fn KERNEL_UNLOCK_ONE "struct lwp *l" |
42 | .Ft void | | 42 | .Ft void |
43 | .Fn KERNEL_UNLOCK_ALL "struct lwp *l" "int *nlocksp" | | 43 | .Fn KERNEL_UNLOCK_ALL "struct lwp *l" "int *nlocksp" |
44 | .Ft void | | 44 | .Ft void |
45 | .Fn KERNEL_UNLOCK_LAST "struct lwp *l" | | 45 | .Fn KERNEL_UNLOCK_LAST "struct lwp *l" |
46 | .Ft bool | | 46 | .Ft bool |
47 | .Fn KERNEL_LOCKED_P | | 47 | .Fn KERNEL_LOCKED_P |
48 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | | 48 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
49 | .Sh DESCRIPTION | | 49 | .Sh DESCRIPTION |
50 | The | | 50 | The |
51 | .Nm | | 51 | .Nm |
52 | facility serves to gradually transition software from the kernel's | | 52 | facility serves to gradually transition software from the kernel's |
53 | legacy uniprocessor execution model, where the kernel runs on only a | | 53 | legacy uniprocessor execution model, where the kernel runs on only a |
54 | single CPU and never in parallel on multiple CPUs, to a multiprocessor | | 54 | single CPU and never in parallel on multiple CPUs, to a multiprocessor |
55 | system. | | 55 | system. |
56 | .Pp | | 56 | .Pp |
57 | .Sy New code should not use Nm . | | 57 | .Sy New code should not use Nm . |
58 | .Nm | | 58 | .Nm |
59 | is meant only for gradual transition of | | 59 | is meant only for gradual transition of |
60 | .Nx | | 60 | .Nx |
61 | to natively MP-safe code, which uses | | 61 | to natively MP-safe code, which uses |
62 | .Xr mutex 9 | | 62 | .Xr mutex 9 |
63 | or other | | 63 | or other |
64 | .Xr locking 9 | | 64 | .Xr locking 9 |
65 | facilities to synchronize between threads and interrupt handlers. | | 65 | facilities to synchronize between threads and interrupt handlers. |
66 | Use of | | 66 | Use of |
67 | .Nm | | 67 | .Nm |
68 | hurts system performance and responsiveness. | | 68 | hurts system performance and responsiveness. |
69 | This man page exists only to document the legacy API in order to make | | 69 | This man page exists only to document the legacy API in order to make |
70 | it easier to transition away from. | | 70 | it easier to transition away from. |
71 | .Pp | | 71 | .Pp |
72 | The kernel lock, sometimes also known as | | 72 | The kernel lock, sometimes also known as |
73 | .Sq giant lock | | 73 | .Sq giant lock |
74 | or | | 74 | or |
75 | .Sq big lock , | | 75 | .Sq big lock , |
76 | is a recursive exclusive spin-lock that can be held by a CPU at any | | 76 | is a recursive exclusive spin-lock that can be held by a CPU at any |
77 | interrupt priority level and is dropped while sleeping. | | 77 | interrupt priority level and is dropped while sleeping. |
78 | This means: | | 78 | This means: |
79 | .Bl -tag -width "held by a CPU" | | 79 | .Bl -tag -width "held by a CPU" |
80 | .It recursive | | 80 | .It recursive |
81 | If a CPU already holds the kernel lock, it can be acquired again and | | 81 | If a CPU already holds the kernel lock, it can be acquired again and |
82 | again, as long as it is released an equal number of times. | | 82 | again, as long as it is released an equal number of times. |
83 | .It exclusive | | 83 | .It exclusive |
84 | Only one CPU at a time can hold the kernel lock. | | 84 | Only one CPU at a time can hold the kernel lock. |
85 | .It spin-lock | | 85 | .It spin-lock |
86 | When one CPU holds the kernel lock and another CPU wants to hold it, | | 86 | When one CPU holds the kernel lock and another CPU wants to hold it, |
87 | the second CPU | | 87 | the second CPU |
88 | .Sq spins , | | 88 | .Sq spins , |
89 | i.e., repeatedly executes instructions to see if the kernel lock is | | 89 | i.e., repeatedly executes instructions to see if the kernel lock is |
90 | available yet, until the first CPU releases it. | | 90 | available yet, until the first CPU releases it. |
91 | During this time, no other threads can run on the spinning CPU. | | 91 | During this time, no other threads can run on the spinning CPU. |
92 | .Pp | | 92 | .Pp |
93 | This means holding the kernel lock for long periods of time, such as | | 93 | This means holding the kernel lock for long periods of time, such as |
94 | nontrivial computation, must be avoided. | | 94 | nontrivial computation, must be avoided. |
95 | Under | | 95 | Under |
96 | .Dv LOCKDEBUG | | 96 | .Dv LOCKDEBUG |
97 | kernels, holding the kernel lock for too long can lead to | | 97 | kernels, holding the kernel lock for too long can lead to |
98 | .Sq spinout | | 98 | .Sq spinout |
99 | crashes. | | 99 | crashes. |
100 | .It held by a CPU | | 100 | .It held by a CPU |
101 | The kernel lock is held by a CPU, not by a process, kthread, LWP, or | | 101 | The kernel lock is held by a CPU, not by a process, kthread, LWP, or |
102 | interrupt handler. | | 102 | interrupt handler. |
103 | It may be shared by a kthread LWP and several softint LWPs at the same | | 103 | It may be shared by a kthread LWP and several softint LWPs at the same |
104 | time, for example, if the softints interrupted the thread on a CPU. | | 104 | time, for example, if the softints interrupted the thread on a CPU. |
105 | .It any interrupt priority level | | 105 | .It any interrupt priority level |
106 | The kernel lock | | 106 | The kernel lock |
107 | .Em does not | | 107 | .Em does not |
108 | block interrupts; subsystems running with the kernel lock use | | 108 | block interrupts; subsystems running with the kernel lock use |
109 | .Xr spl 9 | | 109 | .Xr spl 9 |
110 | to synchronize with interrupt handlers. | | 110 | to synchronize with interrupt handlers. |
111 | .Pp | | 111 | .Pp |
112 | Interrupt handlers that are not marked MP-safe are always run with the | | 112 | Interrupt handlers that are not marked MP-safe are always run with the |
113 | kernel lock. | | 113 | kernel lock. |
114 | If the interrupt arrives on a CPU where the kernel lock is already | | 114 | If the interrupt arrives on a CPU where the kernel lock is already |
115 | held, it is simply taken again recursively on interrupt entry and | | 115 | held, it is simply taken again recursively on interrupt entry and |
116 | released to its original recursion depth on interrupt exit. | | 116 | released to its original recursion depth on interrupt exit. |
117 | .It dropped while sleeping | | 117 | .It dropped while sleeping |
118 | Any time the kernel sleeps to let other threads run, for any reason | | 118 | Any time the kernel sleeps to let other threads run, for any reason |
119 | including | | 119 | including |
120 | .Xr tsleep 9 | | 120 | .Xr tsleep 9 |
121 | or | | 121 | or |
122 | .Xr condvar 9 | | 122 | .Xr condvar 9 |
123 | or even adaptive | | 123 | or even adaptive |
124 | .Xr mutex 9 | | 124 | .Xr mutex 9 |
125 | locks, it releases the kernel lock before going to sleep and then | | 125 | locks, it releases the kernel lock before going to sleep and then |
126 | reacquires it afterward. | | 126 | reacquires it afterward. |
127 | .Pp | | 127 | .Pp |
128 | This means, for instance, that although data structures accessed only | | 128 | This means, for instance, that although data structures accessed only |
129 | under the kernel lock won't be changed before the sleep, they may be | | 129 | under the kernel lock won't be changed before the sleep, they may be |
130 | changed by another thread during the sleep. | | 130 | changed by another thread during the sleep. |
131 | For example, the following program may crash on an assertion failure | | 131 | For example, the following program may crash on an assertion failure |
132 | because the sleep in | | 132 | because the sleep in |
133 | .Xr mutex_enter 9 | | 133 | .Xr mutex_enter 9 |
134 | can allow another CPU to run and change the global variable | | 134 | can allow another CPU to run and change the global variable |
135 | .Dv x : | | 135 | .Dv x : |
136 | .Bd -literal | | 136 | .Bd -literal |
137 | KERNEL_LOCK(1, NULL); | | 137 | KERNEL_LOCK(1, NULL); |
138 | x = 42; | | 138 | x = 42; |
139 | mutex_enter(...); | | 139 | mutex_enter(...); |
140 | ... | | 140 | ... |
141 | mutex_exit(...); | | 141 | mutex_exit(...); |
142 | KASSERT(x == 42); | | 142 | KASSERT(x == 42); |
143 | KERNEL_UNLOCK_ONE(NULL); | | 143 | KERNEL_UNLOCK_ONE(NULL); |
144 | .Ed | | 144 | .Ed |
145 | .Pp | | 145 | .Pp |
146 | This means simply introducing calls to | | 146 | This means simply introducing calls to |
147 | .Xr mutex_enter 9 | | 147 | .Xr mutex_enter 9 |
148 | and | | 148 | and |
149 | .Xr mutex_exit 9 | | 149 | .Xr mutex_exit 9 |
150 | can break kernel-locked assumptions. | | 150 | can break kernel-locked assumptions. |
151 | Subsystems need to be consistently converted from | | 151 | Subsystems need to be consistently converted from |
152 | .Xr KERNEL_LOCK 9 | | 152 | .Nm |
153 | and | | 153 | and |
154 | .Xr spl 9 | | 154 | .Xr spl 9 |
155 | to | | 155 | to |
156 | .Xr mutex 9 , | | 156 | .Xr mutex 9 , |
157 | .Xr condvar 9 , | | 157 | .Xr condvar 9 , |
158 | etc.; mixing | | 158 | etc.; mixing |
159 | .Xr mutex 9 | | 159 | .Xr mutex 9 |
160 | and | | 160 | and |
161 | .Nm | | 161 | .Nm |
162 | usually doesn't work. | | 162 | usually doesn't work. |
163 | .El | | 163 | .El |
164 | .Pp | | 164 | .Pp |
165 | Holding the kernel lock | | 165 | Holding the kernel lock |
166 | .Em does not | | 166 | .Em does not |
167 | prevent other code from running on other CPUs at the same time. | | 167 | prevent other code from running on other CPUs at the same time. |
168 | It only prevents other | | 168 | It only prevents other |
169 | .Em kernel-locked | | 169 | .Em kernel-locked |
170 | code from running on other CPUs at the same time. | | 170 | code from running on other CPUs at the same time. |
171 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | | 171 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
172 | .Sh FUNCTIONS | | 172 | .Sh FUNCTIONS |
173 | .Bl -tag -width abcd | | 173 | .Bl -tag -width abcd |
174 | .It Fn KERNEL_LOCK nlocks l | | 174 | .It Fn KERNEL_LOCK nlocks l |
175 | Acquire | | 175 | Acquire |
176 | .Fa nlocks | | 176 | .Fa nlocks |
177 | recursive levels of kernel lock. | | 177 | recursive levels of kernel lock. |
178 | .Pp | | 178 | .Pp |
179 | If the kernel lock is already held by another CPU, spins until it can | | 179 | If the kernel lock is already held by another CPU, spins until it can |
180 | be acquired by this one. | | 180 | be acquired by this one. |
181 | If the kernel lock is already held by this CPU, records the kernel | | 181 | If the kernel lock is already held by this CPU, records the kernel |
182 | lock recursion depth and returns immediately. | | 182 | lock recursion depth and returns immediately. |
183 | .Pp | | 183 | .Pp |
184 | Most of the time | | 184 | Most of the time |
185 | .Fa nlocks | | 185 | .Fa nlocks |
186 | is 1, but code that deliberately releases all of the kernel locks held | | 186 | is 1, but code that deliberately releases all of the kernel locks held |
187 | by the current CPU in order to sleep and later reacquire the same | | 187 | by the current CPU in order to sleep and later reacquire the same |
188 | number of kernel locks will pass a value of | | 188 | number of kernel locks will pass a value of |
189 | .Fa nlocks | | 189 | .Fa nlocks |
190 | obtained from | | 190 | obtained from |
191 | .Fn KERNEL_UNLOCK_ALL . | | 191 | .Fn KERNEL_UNLOCK_ALL . |
192 | .It Fn KERNEL_UNLOCK_ONE l | | 192 | .It Fn KERNEL_UNLOCK_ONE l |
193 | Release one level of the kernel lock. | | 193 | Release one level of the kernel lock. |
194 | Equivalent to | | 194 | Equivalent to |
195 | .Fo KERNEL_UNLOCK | | 195 | .Fo KERNEL_UNLOCK |
196 | .Li 1 , | | 196 | .Li 1 , |
197 | .Fa l , | | 197 | .Fa l , |
198 | .Dv NULL | | 198 | .Dv NULL |
199 | .Fc . | | 199 | .Fc . |
200 | .It Fn KERNEL_UNLOCK_ALL l nlocksp | | 200 | .It Fn KERNEL_UNLOCK_ALL l nlocksp |
201 | Store the kernel lock recursion depth at | | 201 | Store the kernel lock recursion depth at |
202 | .Fa nlocksp | | 202 | .Fa nlocksp |
203 | and release all recursive levels of the kernel lock. | | 203 | and release all recursive levels of the kernel lock. |
204 | .Pp | | 204 | .Pp |
205 | This is often used inside logic implementing sleep, around a call to | | 205 | This is often used inside logic implementing sleep, around a call to |
206 | .Xr mi_switch 9 , | | 206 | .Xr mi_switch 9 , |
207 | so that the same number of recursive kernel locks can be reacquired | | 207 | so that the same number of recursive kernel locks can be reacquired |
208 | afterward once the thread is reawoken: | | 208 | afterward once the thread is reawoken: |
209 | .Bd -literal | | 209 | .Bd -literal |
210 | int nlocks; | | 210 | int nlocks; |
211 | | | 211 | |
212 | KERNEL_UNLOCK_ALL(l, &nlocks); | | 212 | KERNEL_UNLOCK_ALL(l, &nlocks); |
213 | ... mi_switch(l) ... | | 213 | ... mi_switch(l) ... |
214 | KERNEL_LOCK(nlocks, l); | | 214 | KERNEL_LOCK(nlocks, l); |
215 | .Ed | | 215 | .Ed |
216 | .It Fn KERNEL_UNLOCK_LAST l | | 216 | .It Fn KERNEL_UNLOCK_LAST l |
217 | Release the kernel lock, which must be held at exactly one level. | | 217 | Release the kernel lock, which must be held at exactly one level. |
218 | .Pp | | 218 | .Pp |
219 | This is normally used at the end of a non-MP-safe thread, which was | | 219 | This is normally used at the end of a non-MP-safe thread, which was |
220 | known to have started with exactly one level of the kernel lock, and is | | 220 | known to have started with exactly one level of the kernel lock, and is |
221 | now about to exit. | | 221 | now about to exit. |
222 | .It Fn KERNEL_LOCKED_P | | 222 | .It Fn KERNEL_LOCKED_P |
223 | True if the kernel lock is held. | | 223 | True if the kernel lock is held. |
224 | .Pp | | 224 | .Pp |
225 | To be used only in diagnostic assertions with | | 225 | To be used only in diagnostic assertions with |
226 | .Xr KASSERT 9 . | | 226 | .Xr KASSERT 9 . |
227 | .El | | 227 | .El |
228 | .Pp | | 228 | .Pp |
229 | The legacy argument | | 229 | The legacy argument |
230 | .Fa l | | 230 | .Fa l |
231 | must be | | 231 | must be |
232 | .Dv NULL | | 232 | .Dv NULL |
233 | or | | 233 | or |
234 | .Dv curlwp , | | 234 | .Dv curlwp , |
235 | which mean the same thing. | | 235 | which mean the same thing. |
236 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | | 236 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
237 | .Sh NOTES | | 237 | .Sh NOTES |
238 | Some | | 238 | Some |
239 | .Nx | | 239 | .Nx |
240 | kernel abstractions execute caller-specified funtions with the kernel | | 240 | kernel abstractions execute caller-specified functions with the kernel |
241 | lock held by default, for compatibility with legacy code, but can be | | 241 | lock held by default, for compatibility with legacy code, but can be |
242 | explicitly instructed | | 242 | explicitly instructed |
243 | .Em not | | 243 | .Em not |
244 | to hold the kernel lock by passing an MP-safe flag: | | 244 | to hold the kernel lock by passing an MP-safe flag: |
245 | .Bl -bullet | | 245 | .Bl -bullet |
246 | .It | | 246 | .It |
247 | .Xr callout 9 , | | 247 | .Xr callout 9 , |
248 | .Dv CALLOUT_MPSAFE | | 248 | .Dv CALLOUT_MPSAFE |
249 | .It | | 249 | .It |
250 | .Xr kfilter_register 9 | | 250 | .Xr kfilter_register 9 |
251 | and | | 251 | and |
252 | .Xr knote 9 , | | 252 | .Xr knote 9 , |
253 | .Dv FILTEROPS_MPSAFE | | 253 | .Dv FILTEROPS_MPSAFE |
254 | .It | | 254 | .It |
255 | .Xr kthread 9 , | | 255 | .Xr kthread 9 , |
256 | .Dv KTHREAD_MPSAFE | | 256 | .Dv KTHREAD_MPSAFE |
257 | .It | | 257 | .It |
258 | .Xr pci_intr 9 , | | 258 | .Xr pci_intr 9 , |
259 | .Dv PCI_INTR_MPSAFE | | 259 | .Dv PCI_INTR_MPSAFE |
260 | .It | | 260 | .It |
261 | .Xr scsipi 9 , | | 261 | .Xr scsipi 9 , |
262 | .Dv SCSIPI_ADAPT_MPSAFE | | 262 | .Dv SCSIPI_ADAPT_MPSAFE |
263 | .It | | 263 | .It |
264 | .Xr softint 9 , | | 264 | .Xr softint 9 , |
265 | .Dv SOFTINT_MPSAFE | | 265 | .Dv SOFTINT_MPSAFE |
266 | .It | | 266 | .It |
267 | .Xr usbdi 9 | | 267 | .Xr usbdi 9 |
268 | pipes, | | 268 | pipes, |
269 | .Dv USBD_MPSAFE | | 269 | .Dv USBD_MPSAFE |
270 | .It | | 270 | .It |
271 | .Xr usbdi 9 | | 271 | .Xr usbdi 9 |
272 | tasks, | | 272 | tasks, |
273 | .Dv USB_TASKQ_MPSAFE | | 273 | .Dv USB_TASKQ_MPSAFE |
274 | .It | | 274 | .It |
275 | .Xr vnode 9 , | | 275 | .Xr vnode 9 , |
276 | .Dv VV_MPSAFE | | 276 | .Dv VV_MPSAFE |
277 | .It | | 277 | .It |
278 | .Xr workqueue 9 , | | 278 | .Xr workqueue 9 , |
279 | .Dv WQ_MPSAFE | | 279 | .Dv WQ_MPSAFE |
280 | .El | | 280 | .El |
281 | .Pp | | 281 | .Pp |
282 | The following | | 282 | The following |
283 | .Nx | | 283 | .Nx |
284 | subsystems are still kernel-locked and need re-engineering to take | | 284 | subsystems are still kernel-locked and need re-engineering to take |
285 | advantage of parallelism on multiprocessor systems: | | 285 | advantage of parallelism on multiprocessor systems: |
286 | .Bl -bullet | | 286 | .Bl -bullet |
287 | .It | | 287 | .It |
288 | .Xr ata 4 , | | 288 | .Xr ata 4 , |
289 | .Xr atapi 4 , | | 289 | .Xr atapi 4 , |
290 | .Xr wd 4 | | 290 | .Xr wd 4 |
291 | .It | | 291 | .It |
292 | .Xr video 4 | | 292 | .Xr video 4 |
293 | .It | | 293 | .It |
294 | .Xr autoconf 9 | | 294 | .Xr autoconf 9 |
295 | .It | | 295 | .It |
296 | most of the network stack by default, unless the option | | 296 | most of the network stack by default, unless the option |
297 | .Dv NET_MPSAFE | | 297 | .Dv NET_MPSAFE |
298 | is enabled | | 298 | is enabled |
299 | .It | | 299 | .It |
300 | .No ... | | 300 | .No ... |
301 | .El | | 301 | .El |
302 | .Pp | | 302 | .Pp |
303 | All interrupt handlers at | | 303 | All interrupt handlers at |
304 | .Dv IPL_VM , | | 304 | .Dv IPL_VM , |
305 | or lower | | 305 | or lower |
306 | .Pq Xr spl 9 | | 306 | .Pq Xr spl 9 |
307 | run with the kernel lock on most ports. | | 307 | run with the kernel lock on most ports. |
308 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | | 308 | .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
309 | .Sh SEE ALSO | | 309 | .Sh SEE ALSO |
310 | .Xr locking 9 , | | 310 | .Xr locking 9 , |
311 | .Xr mutex 9 , | | 311 | .Xr mutex 9 , |
312 | .Xr spl 9 | | 312 | .Xr spl 9 |