Re: [PATCH] iommu/amd: move wait_on_sem() out of spinlock
From: Vasant Hegde
Date: Tue Dec 02 2025 - 00:15:13 EST
On 12/1/2025 8:09 PM, Ankit Soni wrote:
> 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@xxxxxxx>
Reviewed-by: Vasant Hegde <vasant.hegde@xxxxxxx>
-Vasant