mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
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>
This commit is contained in:
parent
cf0d53ba49
commit
5c2fefd882
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue