Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c2fefd8 authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Alex Williamson
Browse files

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: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent cf0d53ba
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);