Hi Joerg,

Please pull this series to enable batched unmap support in the IOMMU
core API. Later patches will enable this for Arm SMMUv3, and I suspect
other IOMMU hardware can also benefit from the changes.

The rough idea is to track the current range being unmapped on the stack
of the caller, so that the actual unmap operation in the IOMMU hardware
can be deferred. This deferral allows for optimisations such as batch
submission to the hardware, range invalidation or coalescing of the
operations depending on the hardware capabilities. Crucially, it can
reduce cacheline contention via locks or atomics in the driver code,
which are traditionally exercised on every unmap call to the driver.

Given that this reworks the IOMMU API, the diff is a little messy so
please can you queue this as part of your core changes and let me know
when you have a stable branch? That way, I can use it to resolve any
conflicts with subsequent Arm SMMU driver changes.

If you run into any trouble, please let me know and I'll see what I can
do to help.

Thanks,

Will

--->8

The following changes since commit 5f9e832c137075045d15cd6899ab0505cfb2ca4b:

  Linus 5.3-rc1 (2019-07-21 14:05:38 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git 
for-joerg/batched-unmap

for you to fetch changes up to 3951c41af4a65ba418e6b1b973d398552bedb84f:

  iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->tlb_add_page() 
(2019-07-29 17:22:59 +0100)

----------------------------------------------------------------
Will Deacon (13):
      iommu: Remove empty iommu_tlb_range_add() callback from iommu_ops
      iommu/io-pgtable-arm: Remove redundant call to io_pgtable_tlb_sync()
      iommu/io-pgtable: Rename iommu_gather_ops to iommu_flush_ops
      iommu: Introduce struct iommu_iotlb_gather for batching TLB flushes
      iommu: Introduce iommu_iotlb_gather_add_page()
      iommu: Pass struct iommu_iotlb_gather to ->unmap() and ->iotlb_sync()
      iommu/io-pgtable: Introduce tlb_flush_walk() and tlb_flush_leaf()
      iommu/io-pgtable: Hook up ->tlb_flush_walk() and ->tlb_flush_leaf() in 
drivers
      iommu/io-pgtable-arm: Call ->tlb_flush_walk() and ->tlb_flush_leaf()
      iommu/io-pgtable: Replace ->tlb_add_flush() with ->tlb_add_page()
      iommu/io-pgtable: Remove unused ->tlb_sync() callback
      iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->unmap()
      iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->tlb_add_page()

 drivers/gpu/drm/panfrost/panfrost_mmu.c |  24 +++++---
 drivers/iommu/amd_iommu.c               |  11 ++--
 drivers/iommu/arm-smmu-v3.c             |  52 +++++++++++-----
 drivers/iommu/arm-smmu.c                | 103 ++++++++++++++++++++++++--------
 drivers/iommu/dma-iommu.c               |   9 ++-
 drivers/iommu/exynos-iommu.c            |   3 +-
 drivers/iommu/intel-iommu.c             |   3 +-
 drivers/iommu/io-pgtable-arm-v7s.c      |  57 +++++++++---------
 drivers/iommu/io-pgtable-arm.c          |  48 ++++++++-------
 drivers/iommu/iommu.c                   |  24 ++++----
 drivers/iommu/ipmmu-vmsa.c              |  28 +++++----
 drivers/iommu/msm_iommu.c               |  42 +++++++++----
 drivers/iommu/mtk_iommu.c               |  45 +++++++++++---
 drivers/iommu/mtk_iommu_v1.c            |   3 +-
 drivers/iommu/omap-iommu.c              |   2 +-
 drivers/iommu/qcom_iommu.c              |  44 +++++++++++---
 drivers/iommu/rockchip-iommu.c          |   2 +-
 drivers/iommu/s390-iommu.c              |   3 +-
 drivers/iommu/tegra-gart.c              |  12 +++-
 drivers/iommu/tegra-smmu.c              |   2 +-
 drivers/iommu/virtio-iommu.c            |   5 +-
 drivers/vfio/vfio_iommu_type1.c         |  27 +++++----
 include/linux/io-pgtable.h              |  57 ++++++++++++------
 include/linux/iommu.h                   |  92 +++++++++++++++++++++-------
 24 files changed, 483 insertions(+), 215 deletions(-)
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to