]> Git Repo - linux.git/commitdiff
vfio/spapr: Add cond_resched() for huge updates
authorAlexey Kardashevskiy <[email protected]>
Mon, 2 Oct 2017 18:39:11 +0000 (12:39 -0600)
committerAlex Williamson <[email protected]>
Mon, 2 Oct 2017 18:39:11 +0000 (12:39 -0600)
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 <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
drivers/vfio/vfio_iommu_spapr_tce.c

index 63112c36ab2de129e41b70e2c9db77e17399a781..759a5bdd40e1b37305f4fd850b60a87f1d3aafae 100644 (file)
@@ -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);
This page took 0.054996 seconds and 4 git commands to generate.