tag name | sent/viommu-deferred-flush-v2 (f06685388e99608b6fe65a6040c5dda2d1640f50) |
tag date | 2023-09-18 13:52:05 +0200 |
tagged by | Niklas Schnelle <schnelle@linux.ibm.com> |
tagged object | commit dc9a61acea... |
download | linux-sent/viommu-deferred-flush-v2.tar.gz |
---|
iommu/virtio: Enable IOMMU_CAP_DERRED_FLUSH
Hi All,
Previously I used virtio-iommu as a non-s390x test vehicle[0] for the
single queue flushing scheme introduced by my s390x DMA API conversion
series[1]. For this I modified virtio-iommu to a) use .iotlb_sync_map
and b) enable IOMMU_CAP_DEFERRED_FLUSH. It turned out that deferred
flush and even just the introduction of ops->iotlb_sync_map yield
performance uplift[2] even with per-CPU queues. So here is a small
series of these two changes. This still applies on top of my series[1]
because its first patch titled "iommu: Allow .iotlb_sync_map to fail and
handle s390's -ENOMEM return" enable ops->iotlb_sync_map to return
errors and virtio-iommu's sync can fail. This also makes sure there is
no merge conflict with that series.
The code is also available on the b4/viommu-deferred-flush branch of my
kernel.org git repository[3]
Thanks,
Niklas
[0] https://lore.kernel.org/lkml/20230726111433.1105665-1-schnelle@linux.ibm.com/
[1] https://lore.kernel.org/lkml/20230825-dma_iommu-v12-0-4134455994a7@linux.ibm.com/
[2] https://lore.kernel.org/lkml/20230802123612.GA6142@myrica/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/niks/linux.git/log/?h=b4/viommu-deferred-flush
To: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Joerg Roedel <joro@8bytes.org>
To: Will Deacon <will@kernel.org>
To: Robin Murphy <robin.murphy@arm.com>
Cc: virtualization@lists.linux-foundation.org
Cc: iommu@lists.linux.dev
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
Changes in v2:
- Check for viommu == NULL in viommu_sync_req() instead of for
0 endpoints in ops (Jean-Philippe)
- Added comment where viommu can be NULL (me)
- Link to v1: https://lore.kernel.org/r/20230825-viommu-sync-map-v1-0-56bdcfaa29ec@linux.ibm.com
---
Niklas Schnelle (2):
iommu/virtio: Make use of ops->iotlb_sync_map
iommu/virtio: Add ops->flush_iotlb_all and enable deferred flush
drivers/iommu/virtio-iommu.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
---
base-commit: e165388f6d32dc8a49f49ef6e80584ad3def3d78
change-id: 20230825-viommu-sync-map-1bf0cc4fdc15
Best regards,