From: Alexey Kardashevskiy Date: Mon, 2 Oct 2017 18:39:11 +0000 (-0600) Subject: vfio/spapr: Add cond_resched() for huge updates X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5c2fefd882d3666f11447e3e0fe663a8a7f64cc9;p=linux.git 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 Reviewed-by: David Gibson Signed-off-by: Alex Williamson --- diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c index 63112c36ab2de..759a5bdd40e1b 100644 --- a/drivers/vfio/vfio_iommu_spapr_tce.c +++ b/drivers/vfio/vfio_iommu_spapr_tce.c @@ -507,6 +507,8 @@ static int tce_iommu_clear(struct tce_container *container, enum dma_data_direction direction; for ( ; pages; --pages, ++entry) { + cond_resched(); + direction = DMA_NONE; oldhpa = 0; ret = iommu_tce_xchg(tbl, entry, &oldhpa, &direction);