diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-07-14 02:55:11 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-07-15 09:17:23 +0200 |
commit | acea0018a24b794e32afea4f3be4230c58f2f8e3 (patch) | |
tree | 326c0a66e9ab48637acce9dea20dabe4eefd2023 /drivers/pci/intel-iommu.c | |
parent | intel-iommu: Remove superfluous iova_alloc_lock from IOVA code (diff) | |
download | linux-acea0018a24b794e32afea4f3be4230c58f2f8e3.tar.xz linux-acea0018a24b794e32afea4f3be4230c58f2f8e3.zip |
intel-iommu: Defer the iotlb flush and iova free for intel_unmap_sg() too.
I see no reason why we did this _only_ in intel_unmap_page().
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-rw-r--r-- | drivers/pci/intel-iommu.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index d6a857397ec3..ee48fd073140 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -2815,11 +2815,18 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist, /* free page tables */ dma_pte_free_pagetable(domain, start_pfn, last_pfn); - iommu_flush_iotlb_psi(iommu, domain->id, start_pfn, - (last_pfn - start_pfn + 1)); - - /* free iova */ - __free_iova(&domain->iovad, iova); + if (intel_iommu_strict) { + iommu_flush_iotlb_psi(iommu, domain->id, start_pfn, + last_pfn - start_pfn + 1); + /* free iova */ + __free_iova(&domain->iovad, iova); + } else { + add_unmap(domain, iova); + /* + * queue up the release of the unmap to save the 1/6th of the + * cpu used up by the iotlb flush operation... + */ + } } static int intel_nontranslate_map_sg(struct device *hddev, |