All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Introduce vfio_dma_mapping_perf_test
@ 2026-07-01 20:33 Aaron Lewis
  2026-07-01 20:33 ` [PATCH 1/4] vfio: selftests: " Aaron Lewis
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Aaron Lewis @ 2026-07-01 20:33 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.

This selftest introduces command-line parameters to provide a convenient
way to tune the test for specific situations. For example, it can be used
to observe the lengthy unmap times of the Type 1 IOMMU on large memory
regions, or to compare DMA mapping performance between the Type 1 IOMMU
and IOMMUFD. These scenarios can now be easily configured and run via the
command line.

During development, I abandoned an approach where I initialized memfd
globally in main() for all tests. While that allowed memfd to be
initialized once for all test variants, it proved awkward because a
different memfd would be needed for each supported page size (e.g., 4K,
2M, 1G). Also, If a user is only running a single test variant,
pre-allocating all sizes is unnecessary overhead. Therefore, I dropped
that approach in favor of test-local allocation. However, I'm open to
ideas on a better way to handle this.

Aaron Lewis (4):
  vfio: selftests: Introduce vfio_dma_mapping_perf_test
  vfio: selftests: Add memfd test to vfio_dma_mapping_perf_test
  vfio: selftests: Allow a size for vfio_dma_mapping_perf_test
  vfio: selftests: Allow the flag MAP_POPULATE to be set on the cmdline

 tools/testing/selftests/vfio/Makefile         |   1 +
 .../vfio/lib/include/libvfio/iommu.h          |   7 +
 tools/testing/selftests/vfio/lib/iommu.c      |  24 ++
 .../vfio/vfio_dma_mapping_perf_test.c         | 380 ++++++++++++++++++
 4 files changed, 412 insertions(+)
 create mode 100644 tools/testing/selftests/vfio/vfio_dma_mapping_perf_test.c

-- 
2.55.0.rc0.799.gd6f94ed593-goog


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

end of thread, other threads:[~2026-07-01 20:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 20:33 [PATCH 0/4] Introduce vfio_dma_mapping_perf_test Aaron Lewis
2026-07-01 20:33 ` [PATCH 1/4] vfio: selftests: " Aaron Lewis
2026-07-01 20:44   ` sashiko-bot
2026-07-01 20:33 ` [PATCH 2/4] vfio: selftests: Add memfd test to vfio_dma_mapping_perf_test Aaron Lewis
2026-07-01 20:43   ` sashiko-bot
2026-07-01 20:33 ` [PATCH 3/4] vfio: selftests: Allow a size for vfio_dma_mapping_perf_test Aaron Lewis
2026-07-01 20:44   ` sashiko-bot
2026-07-01 20:33 ` [PATCH 4/4] vfio: selftests: Allow the flag MAP_POPULATE to be set on the cmdline Aaron Lewis

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.