hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9SOOM
-------------------------------
There are could be soft lockup in free_iova_work_func(). Add a schedule point to avoid softlockup.
Call trace: free_iova_work_func+0xdc/0x170 process_one_work+0x1d0/0x4c0 worker_thread+0x150/0x400 kthread+0x104/0x130 ret_from_fork+0x10/0x18 watchdog: BUG: soft lockup - CPU#172 stuck for 23s! [kworker/172:1:1154]
Fixes: 2bc1b6e158c6 ("iommu/iova: avoid softlockup in fq_flush_timeout") Signed-off-by: Zhang Zekun zhangzekun11@huawei.com --- drivers/iommu/iova.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index f3c5b0e887ce..99d5e942aff6 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c @@ -92,6 +92,7 @@ static void free_iova_work_func(struct work_struct *work) spin_lock_irqsave(&fq->lock, flags); fq_ring_free(iovad, fq, cpu); spin_unlock_irqrestore(&fq->lock, flags); + cond_resched(); } }