Skip to content

IOVA allocation improvements for iommu-dma

Nate Watterson linux-arm-kernel linux-iommu 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] IOVA allocation improvements for iommu-dma
Quoted 1 line · Robin Murphy

Hi all,

Hi Robin,

Quoted 14 lines

Here's the first bit of lock contention removal to chew on - feedback welcome! Note that for the current users of the io-pgtable framework, this is most likely to simply push more contention onto the io-pgtable lock, so may not show a great improvement alone. Will and I both have rough proof-of-concept implementations of lock-free io-pgtable code which we need to sit down and agree on at some point, hopefullt fairly soon.

I've taken the opportunity to do a bit of cleanup and refactoring within the series to make the final state of the code nicer, but the diffstat still turns out surprisingly reasonable in the end - it would actually be negative but for the new comments!

Quoted 6 lines

Magnus, Shimoda-san, the first two patches should be of interest as they
constitute the allocation rework I mentioned a while back[1] - if you still need to implement that scary workaround, this should make it simple to hook IPMMU-specific calls into the alloc and free paths, and let the driver take care of the details internally.

I've tested your patches on a QDF2400 platform and generally see modest improvements in iperf/fio performance. As you suspected would happen, contention has indeed moved to the io-pgtable lock. I am looking forward to testing with the lock-free io-pgtable implementation, however I suspect that there will still be contention issues acquiring the (SMMUv3) cmdq lock on the unmap path.

Reviewed/Tested-by: Nate Watterson <[email protected]>

Quoted 13 lines

Robin.

[1]:https://lists.linuxfoundation.org/pipermail/iommu/2017-January/020189.html

Robin Murphy (3):
iommu/dma: Convert to address-based allocation
iommu/dma: Clean up MSI IOVA allocation
iommu/dma: Plumb in the per-CPU IOVA caches

 drivers/iommu/dma-iommu.c | 176 
++++++++++++++++++++++++----------------------
 1 file changed, 90 insertions(+), 86 deletions(-)
Signature · 5 lines
Qualcomm Datacenter Technologies, Inc. on behalf of Qualcomm 
Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a 
Linux
Foundation Collaborative Project.