Skip to content

IOMMU: avoid lock contention in iova allocation

Shaohua Li linux-iommu 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 9 repliesIn review
  2. v14 patches 9 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4IOMMU: add a percpu cache for iova allocationdrivers/iommu/iova.c include/linux/iova.h+89 -80 replies
2/4iommu: free_iova doesn't need lock twicedrivers/iommu/iova.c+37 -250 replies
3/4intel-iommu: remove find_iova in unmap pathdrivers/iommu/intel-iommu.c+39 -230 replies
4/4intel-iommu: do batch iova freedrivers/iommu/intel-iommu.c drivers/iommu/iova.c include/linux/iova.h+44 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 0/4]IOMMU: avoid lock contention in iova allocation

Hi,

iova alloc/free causes big lock contention, which could be easily demonstrated with iperf workload. Previously I posted a patchset:
http://lists.linuxfoundation.org/pipermail/iommu/2015-November/014984.html

the concern is it's not generic. This is another try for the issue. This version implements a per-cpu iova cache for small size DMA allocation (<= 64k), which should be generic enough and so we can do batch allocation. iova free could be easily batched too. With batch alloc/free, iova lock contention disappears. Performance result with this patchset is nearly the same as the previous one in the same test.

After this patchset, async_umap_flush_lock becomes the hotest lock in intel-iommu, but not very bad. That will be something we need work on in the future.

Thanks,
Shaohua

Shaohua Li (4):
IOMMU: add a percpu cache for iova allocation
iommu: free_iova doesn't need lock twice
intel-iommu: remove find_iova in unmap path
intel-iommu: do batch iova free

 drivers/iommu/intel-iommu.c |  77 +++++++++++++------
 drivers/iommu/iova.c        | 177 +++++++++++++++++++++++++++++++++++---------
 include/linux/iova.h        |  10 +++
 3 files changed, 208 insertions(+), 56 deletions(-)
Signature · 1 line
2.4.6