Skip to content

Commit e1907d6

Browse files
Xiang Zhengawilliam
authored andcommitted
vfio/type1: Add conditional rescheduling after iommu map failed
Commit c5e6688 ("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 <[email protected]> Signed-off-by: Alex Williamson <[email protected]>
1 parent bf3551e commit e1907d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/vfio/vfio_iommu_type1.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,8 +1225,10 @@ static int vfio_iommu_map(struct vfio_iommu *iommu, dma_addr_t iova,
12251225
return 0;
12261226

12271227
unwind:
1228-
list_for_each_entry_continue_reverse(d, &iommu->domain_list, next)
1228+
list_for_each_entry_continue_reverse(d, &iommu->domain_list, next) {
12291229
iommu_unmap(d->domain, iova, npage << PAGE_SHIFT);
1230+
cond_resched();
1231+
}
12301232

12311233
return ret;
12321234
}

0 commit comments

Comments
 (0)