Skip to content

Commit 5c2fefd

Browse files
aikAlex Williamson
authored andcommitted
vfio/spapr: Add cond_resched() for huge updates
Clearing very big IOMMU tables can trigger soft lockups. This adds cond_resched() to allow the scheduler to do context switching when it decides to. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
1 parent cf0d53b commit 5c2fefd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/vfio/vfio_iommu_spapr_tce.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ static int tce_iommu_clear(struct tce_container *container,
507507
enum dma_data_direction direction;
508508

509509
for ( ; pages; --pages, ++entry) {
510+
cond_resched();
511+
510512
direction = DMA_NONE;
511513
oldhpa = 0;
512514
ret = iommu_tce_xchg(tbl, entry, &oldhpa, &direction);

0 commit comments

Comments
 (0)