Commit e15768e
iommu/amd: move wait_on_sem() out of spinlock
[ Upstream commit d2a0cac ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 3308c75 commit e15768e
1 file changed
+17
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | | - | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1160 | 1165 | | |
1161 | 1166 | | |
1162 | 1167 | | |
| |||
1401 | 1406 | | |
1402 | 1407 | | |
1403 | 1408 | | |
| 1409 | + | |
| 1410 | + | |
1404 | 1411 | | |
1405 | | - | |
| 1412 | + | |
1406 | 1413 | | |
1407 | 1414 | | |
1408 | 1415 | | |
1409 | | - | |
1410 | | - | |
1411 | | - | |
1412 | 1416 | | |
1413 | 1417 | | |
1414 | 1418 | | |
| |||
3088 | 3092 | | |
3089 | 3093 | | |
3090 | 3094 | | |
3091 | | - | |
| 3095 | + | |
3092 | 3096 | | |
3093 | 3097 | | |
3094 | | - | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
3095 | 3101 | | |
3096 | | - | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
3097 | 3105 | | |
| 3106 | + | |
3098 | 3107 | | |
3099 | 3108 | | |
3100 | 3109 | | |
| |||
0 commit comments