[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200622070217.4768-1-zhengxiang9@huawei.com>
Date: Mon, 22 Jun 2020 15:02:17 +0800
From: Xiang Zheng <zhengxiang9@...wei.com>
To: <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <alex.williamson@...hat.com>, <cohuck@...hat.com>,
<wanghaibin.wang@...wei.com>
Subject: [PATCH] vfio/type1: Add conditional rescheduling after iommu map failed
c5e6688752c25 ("vfio/type1: Add conditional rescheduling") missed
a "cond_resched()" in vfio_iommu_map if iommu map failed.
This is a very tiny optimization and the case can hardly happen.
Signed-off-by: Xiang Zheng <zhengxiang9@...wei.com>
---
drivers/vfio/vfio_iommu_type1.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 5e556ac9102a..48fb9cc4a40a 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -1225,8 +1225,10 @@ static int vfio_iommu_map(struct vfio_iommu *iommu, dma_addr_t iova,
return 0;
unwind:
- list_for_each_entry_continue_reverse(d, &iommu->domain_list, next)
+ list_for_each_entry_continue_reverse(d, &iommu->domain_list, next) {
iommu_unmap(d->domain, iova, npage << PAGE_SHIFT);
+ cond_resched();
+ }
return ret;
}
--
2.19.1
Powered by blists - more mailing lists