Commit c5f0d3e1 authored by Zhang Zekun's avatar Zhang Zekun
Browse files

iommu/iova: Try to schedule out when free iova too long

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: 2bc1b6e1 ("iommu/iova: avoid softlockup in fq_flush_timeout")
Signed-off-by: default avatarZhang Zekun <zhangzekun11@huawei.com>
parent 745f234a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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();
	}
}