Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexey Kardashevskiy and committed by
Alex Williamson
5c2fefd8 cf0d53ba

+2
+2
drivers/vfio/vfio_iommu_spapr_tce.c
··· 507 507 enum dma_data_direction direction; 508 508 509 509 for ( ; pages; --pages, ++entry) { 510 + cond_resched(); 511 + 510 512 direction = DMA_NONE; 511 513 oldhpa = 0; 512 514 ret = iommu_tce_xchg(tbl, entry, &oldhpa, &direction);