Commit 34235a3
Alexei Starovoitov
Merge branch 'limited-queueing-in-nmi-for-rqspinlock'
Kumar Kartikeya Dwivedi says:
====================
Limited queueing in NMI for rqspinlock
Ritesh reported that he was frequently seeing timeouts in cases which
should have been covered by the AA heuristics. This led to the discovery
of multiple gaps in the current code that could lead to timeouts when
AA heuristics could work to prevent them. More details and investigation
is available in the original threads. [0][1]
This set restores the ability for NMI waiters to queue in the slow path,
and reduces the cases where they would attempt to trylock. However, such
queueing must not happen when interrupting waiters which the NMI itself
depends upon for forward progress; in those cases the trylock fallback
remains, but with a single attempt to avoid aimless attempts to acquire
the lock.
It also closes a possible window in the lock fast path and the unlock
path where NMIs landing between cmpxchg and entry creation, or entry
deletion and unlock would miss the detection of an AA scenario and end
up timing out.
This virtually eliminates all the cases where existing heuristics can
prevent timeouts and quickly recover from a deadlock. More details are
available in the commit logs for each patch.
[0]: https://lore.kernel.org/bpf/CAH6OuBTjG+N=+GGwcpOUbeDN563oz4iVcU3rbse68egp9wj9_A@mail.gmail.com
[1]: https://lore.kernel.org/bpf/[email protected]
====================
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>File tree
3 files changed
+108
-76
lines changed- include/asm-generic
- kernel/bpf
- tools/testing/selftests/bpf/test_kmods
3 files changed
+108
-76
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | 132 | | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 142 | + | |
| 143 | + | |
149 | 144 | | |
150 | 145 | | |
151 | 146 | | |
| |||
175 | 170 | | |
176 | 171 | | |
177 | 172 | | |
178 | | - | |
179 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
180 | 188 | | |
181 | | - | |
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
| |||
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | 202 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
204 | 207 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
208 | 211 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
215 | 217 | | |
216 | 218 | | |
| 219 | + | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | 199 | | |
214 | 200 | | |
215 | 201 | | |
216 | | - | |
217 | 202 | | |
| 203 | + | |
218 | 204 | | |
219 | 205 | | |
220 | | - | |
221 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
222 | 210 | | |
223 | 211 | | |
224 | 212 | | |
| 213 | + | |
225 | 214 | | |
226 | 215 | | |
227 | 216 | | |
| |||
231 | 220 | | |
232 | 221 | | |
233 | 222 | | |
234 | | - | |
| 223 | + | |
235 | 224 | | |
236 | 225 | | |
237 | 226 | | |
| |||
275 | 264 | | |
276 | 265 | | |
277 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
278 | 271 | | |
279 | 272 | | |
280 | 273 | | |
| |||
397 | 390 | | |
398 | 391 | | |
399 | 392 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 393 | + | |
404 | 394 | | |
405 | 395 | | |
406 | 396 | | |
| |||
447 | 437 | | |
448 | 438 | | |
449 | 439 | | |
450 | | - | |
451 | 440 | | |
452 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
453 | 447 | | |
454 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
455 | 452 | | |
| 453 | + | |
| 454 | + | |
456 | 455 | | |
457 | 456 | | |
458 | 457 | | |
| |||
464 | 463 | | |
465 | 464 | | |
466 | 465 | | |
467 | | - | |
468 | | - | |
469 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
470 | 471 | | |
471 | | - | |
| 472 | + | |
472 | 473 | | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
480 | 477 | | |
481 | 478 | | |
482 | 479 | | |
| |||
Lines changed: 43 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
36 | 42 | | |
37 | | - | |
38 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
117 | 124 | | |
118 | 125 | | |
119 | 126 | | |
120 | | - | |
| 127 | + | |
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
125 | | - | |
| 132 | + | |
126 | 133 | | |
127 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
128 | 139 | | |
129 | 140 | | |
130 | 141 | | |
| |||
147 | 158 | | |
148 | 159 | | |
149 | 160 | | |
150 | | - | |
| 161 | + | |
| 162 | + | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
| |||
190 | 202 | | |
191 | 203 | | |
192 | 204 | | |
193 | | - | |
| 205 | + | |
| 206 | + | |
194 | 207 | | |
195 | 208 | | |
196 | 209 | | |
| |||
300 | 313 | | |
301 | 314 | | |
302 | 315 | | |
| 316 | + | |
| 317 | + | |
303 | 318 | | |
304 | 319 | | |
305 | 320 | | |
306 | 321 | | |
307 | | - | |
308 | | - | |
| 322 | + | |
| 323 | + | |
309 | 324 | | |
310 | 325 | | |
311 | 326 | | |
| |||
315 | 330 | | |
316 | 331 | | |
317 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
318 | 340 | | |
319 | 341 | | |
320 | 342 | | |
321 | 343 | | |
322 | | - | |
323 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
324 | 351 | | |
325 | 352 | | |
326 | 353 | | |
327 | | - | |
328 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
329 | 360 | | |
330 | 361 | | |
331 | 362 | | |
| |||
0 commit comments