summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2017-10-02 12:39:11 -0600
committerAlex Williamson <alex.williamson@redhat.com>2017-10-02 12:39:11 -0600
commit5c2fefd882d3666f11447e3e0fe663a8a7f64cc9 (patch)
treec35a2f80c9b27b5ee1dfff0d834a3ee70cd262f0 /drivers
parentcf0d53ba4947aad6e471491d5b20a567cbe92e56 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/vfio/vfio_iommu_spapr_tce.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
index 63112c36ab2d..759a5bdd40e1 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);