RFC vfio: Improve DMA mapping performance for huge pages
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | vfio: Improve DMA mapping performance for huge pagesdrivers/ | +29 | 6 replies | |
| 2/2 | vfio: selftest: Add vfio_dma_mapping_perf_testtools/ tools/ | +248 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/2] vfio: Improve DMA mapping performance for huge pages
This RFC explores the current state of DMA mapping performance across vfio, and proposes an implementation to improve the performance for "vfio_type1_iommu" for huge pages.
In putting this together the IOMMU modes: vfio_type1_iommu, iommufd_compat_type1, and iommufd were used to get performance metrics using the selftest, "vfio_dma_mapping_perf_test" (included in this series).
These changes were developed on the branch "vfio/next" in the repro:
- https://github.com/awilliam/linux-vfio
The optimization demonstrated in patch 1/2 shows a >300x speed up when pinning gigantic pages in "vfio_type1_iommu". More work will be needed to improve iommufd's mapping performance for gigantic pages, but a callstack showing the slow path is included in that patch to help drive the conversation forward.
The iommu mode "iommufd_compat_type1" lags much farther behind the other two. If the intention is to have it perform on par (or near par) I can attach a callstack in a follow up to see if there is any low hanging fruit to be had. But as it sits right now the performance of this iommu mode is an order of magnitude slower than the others.
This is being sent as an RFC because while there is a proposed solution for "vfio_type1_iommu", there are no solutions for the other two iommu modes. Attached is a callstack in patch 1/2 showing where the latency issues are for iommufd, however, I haven't posted one
for "iommufd_compat_type1". I'm also not clear on what the intention is for "iommufd_compat_type1" w.r.t. this issue. Especially given it is so much slower than the others.
Aaron Lewis (2):
vfio: Improve DMA mapping performance for huge pages
vfio: selftest: Add vfio_dma_mapping_perf_test
drivers/vfio/vfio_iommu_type1.c | 37 ++- tools/testing/selftests/vfio/Makefile | 1 + .../vfio/vfio_dma_mapping_perf_test.c | 247 ++++++++++++++++++ 3 files changed, 277 insertions(+), 8 deletions(-) create mode 100644 tools/testing/selftests/vfio/vfio_dma_mapping_perf_test.c
Signature · 1 line
2.52.0.351.gbe84eed79e-goog