Commit d2a0cac
iommu/amd: move wait_on_sem() out of spinlock
With iommu.strict=1, the existing completion wait path can cause soft
lockups under stressed environment, as wait_on_sem() busy-waits under the
spinlock with interrupts disabled.
Move the completion wait in iommu_completion_wait() out of the spinlock.
wait_on_sem() only polls the hardware-updated cmd_sem and does not require
iommu->lock, so holding the lock during the busy wait unnecessarily
increases contention and extends the time with interrupts disabled.
Signed-off-by: Ankit Soni <Ankit.Soni@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>1 parent 9ace475 commit d2a0cac
1 file changed
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | | - | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1189 | 1194 | | |
1190 | 1195 | | |
1191 | 1196 | | |
| |||
1437 | 1442 | | |
1438 | 1443 | | |
1439 | 1444 | | |
| 1445 | + | |
| 1446 | + | |
1440 | 1447 | | |
1441 | | - | |
| 1448 | + | |
1442 | 1449 | | |
1443 | 1450 | | |
1444 | 1451 | | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | 1452 | | |
1449 | 1453 | | |
1450 | 1454 | | |
| |||
3121 | 3125 | | |
3122 | 3126 | | |
3123 | 3127 | | |
3124 | | - | |
| 3128 | + | |
3125 | 3129 | | |
3126 | 3130 | | |
3127 | | - | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
3128 | 3134 | | |
3129 | | - | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
3130 | 3138 | | |
| 3139 | + | |
3131 | 3140 | | |
3132 | 3141 | | |
3133 | 3142 | | |
| |||
0 commit comments