summaryrefslogtreecommitdiff
path: root/drivers/vfio
diff options
context:
space:
mode:
authorXiang Zheng <zhengxiang9@huawei.com>2020-07-27 13:43:37 -0600
committerAlex Williamson <alex.williamson@redhat.com>2020-07-27 13:43:37 -0600
commite1907d6752a26ccfcda1573b5a7542b056553046 (patch)
tree12970757490d86870bc444c1300551dd912cfc98 /drivers/vfio
parentbf3551e150e5a231ac60f2bd750f63ab5484010a (diff)
downloadlinux-e1907d6752a26ccfcda1573b5a7542b056553046.tar.gz
vfio/type1: Add conditional rescheduling after iommu map failed
Commit c5e6688752c2 ("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@huawei.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/vfio_iommu_type1.c4
1 files changed, 3 insertions, 1 deletions
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;
}