All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] Introduce vfio_dma_mapping_perf_test
@ 2026-11-14 13:21 Aaron Lewis
  2026-11-14 13:21 ` [PATCH v4 1/5] vfio: selftests: Assert the region was unmapped in iommu_unmap() Aaron Lewis
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Aaron Lewis @ 2026-11-14 13:21 UTC (permalink / raw)
  To: kvm; +Cc: alex, dmatlack, jgg, Aaron Lewis

Add a new VFIO selftest, vfio_dma_mapping_perf_test, to provide a
configurable tool for measuring DMA mapping and unmapping latencies
across backing memory types, IOMMU backends, and region sizes.

For example, running the test across various region sizes (backed by 1G
HugeTLB pages) makes it easy to collect and compare latencies:

Map latency:

IOCTL               |      1G  |      4G  |     32G  |     128G
--------------------+----------+----------+----------+-----------
VFIO_IOMMU_MAP_DMA  |  0.39 ms |  1.38 ms | 11.62 ms |  46.54 ms
IOMMU_IOAS_MAP      |  0.58 ms |  2.27 ms | 18.08 ms |  73.49 ms
IOMMU_IOAS_MAP_FILE |  0.01 ms |  0.02 ms |  0.10 ms |   0.32 ms

Unmap latency:

IOCTL               |      1G  |      4G  |     32G  |     128G
--------------------+----------+----------+----------+-----------
VFIO_IOMMU_MAP_DMA  |  1.51 ms |  5.69 ms | 45.78 ms | 187.66 ms
IOMMU_IOAS_MAP      |  1.84 ms |  6.83 ms | 52.53 ms | 211.75 ms
IOMMU_IOAS_MAP_FILE |  1.78 ms |  6.74 ms | 61.26 ms | 213.70 ms

The numbers in the tables were collected on EMR.

Changes in v4:
 - Split kselftest_harness.h custom CLI option support into its own patch
 - Printed usage help on invalid options and passed custom optstring to
   test_enabled()
 - Skipped variants when the '-b' size is not aligned to the page size
 - Renamed timer_start() to timer_get()

v3: https://lore.kernel.org/kvm/20260910153326.3085937-1-aaronlewis@google.com/

Aaron Lewis (5):
  vfio: selftests: Assert the region was unmapped in iommu_unmap()
  vfio: selftests: Introduce vfio_dma_mapping_perf_test
  vfio: selftests: Add memfd test to vfio_dma_mapping_perf_test
  selftests: harness: Support custom command-line options
  vfio: selftests: Allow a size for vfio_dma_mapping_perf_test

 tools/testing/selftests/kselftest_harness.h   | 127 +++++---
 tools/testing/selftests/vfio/Makefile         |   1 +
 .../selftests/vfio/lib/include/libvfio.h      |  31 ++
 .../vfio/lib/include/libvfio/iommu.h          |  14 +-
 tools/testing/selftests/vfio/lib/iommu.c      |  24 ++
 .../vfio/vfio_dma_mapping_perf_test.c         | 279 ++++++++++++++++++
 .../selftests/vfio/vfio_dma_mapping_test.c    |  11 +-
 7 files changed, 444 insertions(+), 43 deletions(-)
 create mode 100644 tools/testing/selftests/vfio/vfio_dma_mapping_perf_test.c

-- 
2.56.0.611.g1030f0b940-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-14 13:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 13:21 [PATCH v4 0/5] Introduce vfio_dma_mapping_perf_test Aaron Lewis
2026-11-14 13:21 ` [PATCH v4 1/5] vfio: selftests: Assert the region was unmapped in iommu_unmap() Aaron Lewis
2026-11-14 13:21 ` [PATCH v4 2/5] vfio: selftests: Introduce vfio_dma_mapping_perf_test Aaron Lewis
2026-11-14 13:21 ` [PATCH v4 3/5] vfio: selftests: Add memfd test to vfio_dma_mapping_perf_test Aaron Lewis
2026-11-14 13:21 ` [PATCH v4 4/5] selftests: harness: Support custom command-line options Aaron Lewis
2026-11-14 13:22 ` [PATCH v4 5/5] vfio: selftests: Allow a size for vfio_dma_mapping_perf_test Aaron Lewis
2026-11-14 13:29   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.