summaryrefslogtreecommitdiffstats
path: root/kernel/dma/Kconfig
diff options
context:
space:
mode:
authorBarry Song <song.bao.hua@hisilicon.com>2020-11-16 19:08:47 +1300
committerChristoph Hellwig <hch@lst.de>2020-11-27 10:33:42 +0100
commit65789daa8087e125927230ccb7e1eab13999b0cf (patch)
tree86351d7870a8879dd702b1a801a3c97fce08a083 /kernel/dma/Kconfig
parent819b70ad620119d21a9e4be6ad665ece26fc0db8 (diff)
downloadlinux-stable-65789daa8087e125927230ccb7e1eab13999b0cf.tar.gz
linux-stable-65789daa8087e125927230ccb7e1eab13999b0cf.tar.bz2
linux-stable-65789daa8087e125927230ccb7e1eab13999b0cf.zip
dma-mapping: add benchmark support for streaming DMA APIs
Nowadays, there are increasing requirements to benchmark the performance of dma_map and dma_unmap particually while the device is attached to an IOMMU. This patch enables the support. Users can run specified number of threads to do dma_map_page and dma_unmap_page on a specific NUMA node with the specified duration. Then dma_map_benchmark will calculate the average latency for map and unmap. A difficulity for this benchmark is that dma_map/unmap APIs must run on a particular device. Each device might have different backend of IOMMU or non-IOMMU. So we use the driver_override to bind dma_map_benchmark to a particual device by: For platform devices: echo dma_map_benchmark > /sys/bus/platform/devices/xxx/driver_override echo xxx > /sys/bus/platform/drivers/xxx/unbind echo xxx > /sys/bus/platform/drivers/dma_map_benchmark/bind For PCI devices: echo dma_map_benchmark > /sys/bus/pci/devices/0000:00:01.0/driver_override echo 0000:00:01.0 > /sys/bus/pci/drivers/xxx/unbind echo 0000:00:01.0 > /sys/bus/pci/drivers/dma_map_benchmark/bind Cc: Will Deacon <will@kernel.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com> [hch: folded in two fixes from Colin Ian King <colin.king@canonical.com>] Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel/dma/Kconfig')
-rw-r--r--kernel/dma/Kconfig9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 43d106598e82..ba50d4588bc5 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -229,3 +229,12 @@ config DMA_API_DEBUG_SG
is technically out-of-spec.
If unsure, say N.
+
+config DMA_MAP_BENCHMARK
+ bool "Enable benchmarking of streaming DMA mapping"
+ depends on DEBUG_FS
+ help
+ Provides /sys/kernel/debug/dma_map_benchmark that helps with testing
+ performance of dma_(un)map_page.
+
+ See tools/testing/selftests/dma/dma_map_benchmark.c