[PATCH v4] iommu/arm-smmu-v3: permit users to disable msi polling

2020-08-18 Thread Barry Song
a command line option so that users can decide to use MSI polling or not based on their tests. Signed-off-by: Barry Song --- -v4: rebase on top of 5.9-rc1 refine changelog drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff

[PATCH v4 1/3] iommu/arm-smmu-v3: replace symbolic permissions by octal permissions for module parameter

2020-08-18 Thread Barry Song
module parameter of bypass_ * add ARM_SMMU_OPT_MSIPOLL flag with respect to Robin's comments Signed-off-by: Barry Song --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers

[PATCH v4 3/3] iommu/arm-smmu-v3: permit users to disable msi polling

2020-08-18 Thread Barry Song
a command line option so that users can decide to use MSI polling or not based on their tests. Signed-off-by: Barry Song --- -v4: add ARM_SMMU_OPT_MSIPOLL flag with respect to Robin's comment drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 17 - 1 file changed, 12 insertions(+), 5

[PATCH v4 0/3] iommu/arm-smmu-v3: permit users to disable msi polling

2020-08-18 Thread Barry Song
to check a bit in options rather than two bits in features Barry Song (3): iommu/arm-smmu-v3: replace symbolic permissions by octal permissions for module parameter iommu/arm-smmu-v3: replace module_param_named by module_param for disable_bypass iommu/arm-smmu-v3: permit users

[PATCH v4 2/3] iommu/arm-smmu-v3: replace module_param_named by module_param for disable_bypass

2020-08-18 Thread Barry Song
Just use module_param() - going out of the way to specify a "different" name that's identical to the variable name is silly. Signed-off-by: Barry Song --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/ar

[PATCH v7 3/3] mm: cma: use CMA_MAX_NAME to define the length of cma name array

2020-08-21 Thread Barry Song
Cc: Roman Gushchin Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Will Deacon Cc: Robin Murphy Cc: Andrew Morton Signed-off-by: Barry Song --- this patch is fixing the magic number issue with respect to Will's comment here: https://lore.kernel.org/linux-iommu

[PATCH v7 1/3] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-21 Thread Barry Song
: Christoph Hellwig Cc: Marek Szyprowski Cc: Will Deacon Cc: Robin Murphy Cc: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v7: with respect to Will's comments * move to use

[PATCH v7 0/3] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-08-21 Thread Barry Song
e dma_pernuma_cma_reserve() after hugetlb_cma_reserve() to reuse the comment before hugetlb_cma_reserve() with respect to Robin's comment -v2: * fix some issues reported by kernel test robot * fallback to default cma while allocation fails in per-numa cma free memory properly Barry So

[PATCH v7 2/3] arm64: mm: reserve per-numa CMA to localize coherent dma buffers

2020-08-21 Thread Barry Song
: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v7: add Will's acked-by arch/arm64/mm/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm

[PATCH v6 1/2] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-20 Thread Barry Song
: Christoph Hellwig Cc: Marek Szyprowski Cc: Will Deacon Cc: Robin Murphy Cc: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- v6: rebase on top of 5.9-rc1; doc cleanup .../admin-guide

[PATCH v6 0/2] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-08-20 Thread Barry Song
serve() with respect to Robin's comment -v2: * fix some issues reported by kernel test robot * fallback to default cma while allocation fails in per-numa cma free memory properly Barry Song (2): dma-contiguous: provide the ability to reserve per-numa CMA arm64: mm: reserve per-numa CMA

[PATCH v6 2/2] arm64: mm: reserve per-numa CMA to localize coherent dma buffers

2020-08-20 Thread Barry Song
: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v6: rebase on top of 5.9-rc1 arch/arm64/mm/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm

[PATCH v5 1/3] iommu/arm-smmu-v3: replace symbolic permissions by octal permissions for module parameter

2020-08-27 Thread Barry Song
Signed-off-by: Barry Song --- -v5: add Robin's reviewed-by drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 7196207be7ea..eea5f7c6d9ab

[PATCH v5 0/3] iommu/arm-smmu-v3: permit users to disable msi polling

2020-08-27 Thread Barry Song
. on the other hand, we only need to check a bit in options rather than two bits in features Barry Song (3): iommu/arm-smmu-v3: replace symbolic permissions by octal permissions for module parameter iommu/arm-smmu-v3: replace module_param_named by module_param for disable_bypass iommu

[PATCH v5 3/3] iommu/arm-smmu-v3: permit users to disable msi polling

2020-08-27 Thread Barry Song
a command line option so that users can decide to use MSI polling or not based on their tests. Reviewed-by: Robin Murphy Signed-off-by: Barry Song --- -v5: add Robin's reviewed-by drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 17 - 1 file changed, 12 insertions(+), 5 deletions

[PATCH v5 2/3] iommu/arm-smmu-v3: replace module_param_named by module_param for disable_bypass

2020-08-27 Thread Barry Song
Just use module_param() - going out of the way to specify a "different" name that's identical to the variable name is silly. Reviewed-by: Robin Murphy Signed-off-by: Barry Song --- -v5: add Robin's reviewed-by drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- 1 file changed, 1

[PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-27 Thread Barry Song
cmdq_issue_cmdlist() is the hotspot that uses a lot of time. This patch adds tracepoints for it to help debug. Signed-off-by: Barry Song --- * can furthermore develop an eBPF program to benchmark using this trace cmdlistlat.c: #include BPF_HASH(start, u32); BPF_HISTOGRAM(dist

[PATCH v8 1/3] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-23 Thread Barry Song
: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v8: * rename parameter from pernuma_cma to cma_pernuma with respect to the comments of Mike Rapoport and Randy Dunlap * if both hugetlb_cma and pernuma_cma are enabled, we may need a larger default CMA_AREAS. In numa, we set

[PATCH v8 3/3] mm: cma: use CMA_MAX_NAME to define the length of cma name array

2020-08-23 Thread Barry Song
Kravetz Cc: Roman Gushchin Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Will Deacon Cc: Robin Murphy Cc: Andrew Morton Signed-off-by: Barry Song --- this patch is fixing the magic number issue with respect to Will's comment here: https://lore.kernel.org/linux-iommu

[PATCH v8 2/3] arm64: mm: reserve per-numa CMA to localize coherent dma buffers

2020-08-23 Thread Barry Song
: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- arch/arm64/mm/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 481d22c32a2e

[PATCH v8 0/3] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-08-23 Thread Barry Song
_reserve() to reuse the comment before hugetlb_cma_reserve() with respect to Robin's comment -v2: * fix some issues reported by kernel test robot * fallback to default cma while allocation fails in per-numa cma free memory properly Barry Song (3): dma-contiguous: provide the ability to

[PATCH] iommu/arm-smmu-v3: expose numa_node attribute to users in sysfs

2020-05-30 Thread Barry Song
it without checking hardware spec at all. Signed-off-by: Barry Song --- drivers/iommu/arm-smmu-v3.c | 40 - 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 82508730feb7..754c4d59498b

[PATCH] driver core: platform: expose numa_node to users in sysfs

2020-06-01 Thread Barry Song
Zeng Cc: Robin Murphy Signed-off-by: Barry Song --- drivers/base/platform.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index b27d0f6c18c9..7794b9a38d82 100644 --- a/drivers/base/platform.c +++ b

[PATCH] iommu/arm-smmu-v3: allocate the memory of queues in local numa node

2020-06-01 Thread Barry Song
de2, without this patch, it takes 550ns to wait for the completion of CMD_SYNC; with this patch, it takes 250ns to wait for the completion of CMD_SYNC. Signed-off-by: Barry Song --- drivers/iommu/arm-smmu-v3.c | 63 - 1 file changed, 48 insertions(+), 15 d

[PATCH v2] driver core: platform: expose numa_node to users in sysfs

2020-06-01 Thread Barry Song
Zeng Cc: Robin Murphy Signed-off-by: Barry Song --- -v2: add the numa_node entry in Documentation/ABI/ Documentation/ABI/testing/sysfs-bus-platform | 10 drivers/base/platform.c | 26 +++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git

[PATCH 0/2] dma-mapping: provide a benchmark for streaming DMA mapping

2020-10-26 Thread Barry Song
to "dma_map_benchmark" platform_driver or pci_driver for benchmarking. In this patchset, I prefer to use the driver_override and avoid the various hack in kernel. We can dynamically switch devices behind different IOMMUs to get the performance of dma map on IOMMU or non-IOMMU. Barry Song (2): dma-ma

[PATCH 2/2] selftests/dma: add test application for DMA_MAP_BENCHMARK

2020-10-26 Thread Barry Song
9 average unmap_nsec:2423 Cc: Joerg Roedel Cc: Will Deacon Cc: Shuah Khan Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Signed-off-by: Barry Song --- MAINTAINERS | 6 ++ tools/testing/selftests/dma/Makefile | 6 ++ tools

[PATCH 1/2] dma-mapping: add benchmark support for streaming DMA APIs

2020-10-26 Thread Barry Song
will also be supported afterwards. Cc: Joerg Roedel Cc: Will Deacon Cc: Shuah Khan Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Signed-off-by: Barry Song --- kernel/dma/Kconfig | 8 ++ kernel/dma/Makefile| 1 + kernel/dma/map_benchmar

[PATCH v3] iommu/arm-smmu-v3: permit users to disable MSI polling

2020-08-01 Thread Barry Song
decide to use MSI polling or not based on their tests. Signed-off-by: Barry Song --- -v3: * rebase on top of linux-next as arm-smmu-v3.c has moved; * provide a command line option drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 18 ++ 1 file changed, 14 insertions(+), 4

[PATCH v5 2/2] arm64: mm: reserve per-numa CMA to localize coherent dma buffers

2020-07-31 Thread Barry Song
: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- arch/arm64/mm/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index b6881d61b818

[PATCH v5 1/2] dma-contiguous: provide the ability to reserve per-numa CMA

2020-07-31 Thread Barry Song
: Christoph Hellwig Cc: Marek Szyprowski Cc: Will Deacon Cc: Robin Murphy Cc: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v5: refine code according to Christoph Hellwig's comments

[PATCH v5 0/2] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-07-31 Thread Barry Song
e dma_pernuma_cma_reserve() after hugetlb_cma_reserve() to reuse the comment before hugetlb_cma_reserve() with respect to Robin's comment -v2: * fix some issues reported by kernel test robot * fallback to default cma while allocation fails in per-numa cma free memory properly Barry So

[PATCH v2 1/2] dma-direct: provide the ability to reserve per-numa CMA

2020-06-25 Thread Barry Song
Hellwig Cc: Marek Szyprowski Cc: Will Deacon Cc: Robin Murphy Cc: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- include/linux/dma-contiguous.h | 4 ++ kernel/dma/Kconfig

[PATCH v2 0/2] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-06-25 Thread Barry Song
allocation fails in per-numa cma according to Jonathan Cameron's suggestion; free memory properly Barry Song (2): dma-direct: provide the ability to reserve per-numa CMA arm64: mm: reserve per-numa CMA after numa_init arch/arm64/mm/init.c | 2 + include/linux/dma-contigu

[PATCH v2 2/2] arm64: mm: reserve per-numa CMA after numa_init

2020-06-25 Thread Barry Song
: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- arch/arm64/mm/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 1e93cfc7c47a

[PATCH v3 2/2] arm64: mm: reserve per-numa CMA to localize coherent dma buffers

2020-06-28 Thread Barry Song
: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v3: * move dma_pernuma_cma_reserve() after hugetlb_cma_reserve() to reuse the comment before hugetlb_cma_reserve() with respect to Robin's

[PATCH v3 0/2] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-06-28 Thread Barry Song
omment before hugetlb_cma_reserve() with respect to Robin's comment -v2: * fix some issues reported by kernel test robot * fallback to default cma while allocation fails in per-numa cma free memory properly Barry Song (2): dma-direct: provide the ability to reserve per-numa CMA arm64: mm:

[PATCH v3 1/2] dma-direct: provide the ability to reserve per-numa CMA

2020-06-28 Thread Barry Song
Hellwig Cc: Marek Szyprowski Cc: Will Deacon Cc: Robin Murphy Cc: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v3: * move to use page_to_nid() while freeing cma with respect

[PATCH 2/3] arm64: mm: reserve hugetlb CMA after numa_init

2020-06-02 Thread Barry Song
hugetlb_cma_reserve() is called at the wrong place. numa_init has not been done yet. so all reserved memory will be located at node0. Cc: Roman Gushchin Signed-off-by: Barry Song --- arch/arm64/mm/init.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64

[PATCH 0/3] support per-numa CMA for ARM server

2020-06-02 Thread Barry Song
memory from local numa node to save command queues and page tables. that means dma_unmap latency will be shrunk much. Meanwhile, when iommu.passthrough is on, device drivers which call dma_ alloc_coherent() will also get local memory and avoid the travel between numa nodes. Barry Song (3): dma-direct

[PATCH 1/3] dma-direct: provide the ability to reserve per-numa CMA

2020-06-02 Thread Barry Song
-by: Barry Song --- include/linux/dma-contiguous.h | 4 kernel/dma/Kconfig | 10 + kernel/dma/contiguous.c| 41 +- 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/include/linux/dma-contiguous.h b/include/linux/dma

[PATCH 3/3] arm64: mm: reserve per-numa CMA after numa_init

2020-06-02 Thread Barry Song
tables. that means dma_unmap latency will be shrunk much. Meanwhile, when iommu.passthrough is on, device drivers which call dma_ alloc_coherent() will also get local memory and avoid the travel between numa nodes. Cc: Will Deacon Cc: Robin Murphy Signed-off-by: Barry Song --- arch/arm64/mm/init.c

[PATCH v4 1/2] dma-direct: provide the ability to reserve per-numa CMA

2020-07-23 Thread Barry Song
: Christoph Hellwig Cc: Marek Szyprowski Cc: Will Deacon Cc: Robin Murphy Cc: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v4: * rebase on top of Christoph Hellwig's patch: [PATCH v2] dma

[PATCH v4 0/2] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-07-23 Thread Barry Song
serve() after hugetlb_cma_reserve() to reuse the comment before hugetlb_cma_reserve() with respect to Robin's comment -v2: * fix some issues reported by kernel test robot * fallback to default cma while allocation fails in per-numa cma free memory properly Barry Song (2): dma-direct: provid

[PATCH v4 2/2] arm64: mm: reserve per-numa CMA to localize coherent dma buffers

2020-07-23 Thread Barry Song
: Ganapatrao Kulkarni Cc: Catalin Marinas Cc: Nicolas Saenz Julienne Cc: Steve Capper Cc: Andrew Morton Cc: Mike Rapoport Signed-off-by: Barry Song --- -v4: * rebase on top of linux-next to avoid arch/arm64 conflicts arch/arm64/mm/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v2] iommu/arm-smmu-v3: disable MSI polling if SEV polling is faster

2020-07-31 Thread Barry Song
to strict, TX throughput can improve from 25Gbps to 27Gbps by this patch. This patch adds a generic function to support implementation options based on IIDR and disables MSI polling if IIDR matches the specific implementation tested. Cc: Prime Zeng Signed-off-by: Barry Song --- -v2: rather than

[PATCH] iommu/arm-smmu-v3: remove the approach of MSI polling for CMD SYNC

2020-07-16 Thread Barry Song
rf on hns3 100G NIC with UDP packet size in 32768bytes and set iommu to strict, TX throughput can improve from 25227.74Mbps to 27145.59Mbps by this patch. In this case, SMMU is super busy as hns3 sends map/unmap requests extremely frequently. Cc: Prime Zeng Signed-off-by: Barry Song --- drivers

[PATCH] dma-mapping: benchmark: fix kernel crash when dma_map_single fails

2021-01-07 Thread Barry Song
(f8626802) [ 48.112884] ---[ end trace d4890e21e75419d5 ]--- Signed-off-by: Barry Song --- kernel/dma/map_benchmark.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c index b1496e744c68..1b1b8ff875cb 100644

[PATCH] dma-mapping: benchmark: check the validity of dma mask bits

2020-12-12 Thread Barry Song
While dma_mask_bits is larger than 64, the bahvaiour is undefined. On the other hand, dma_mask_bits which is smaller than 20 (1MB) makes no sense in real hardware. Reported-by: Dan Carpenter Signed-off-by: Barry Song --- kernel/dma/map_benchmark.c | 6 ++ 1 file changed, 6 insertions

[PATCH v4 1/2] dma-mapping: add benchmark support for streaming DMA APIs

2020-11-15 Thread Barry Song
/sys/bus/pci/devices/:00:01.0/driver_override echo :00:01.0 > /sys/bus/pci/drivers/xxx/unbind echo :00:01.0 > /sys/bus/pci/drivers/dma_map_benchmark/bind Cc: Will Deacon Cc: Shuah Khan Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Signed-off-by: Barry Song --

[PATCH v4 0/2] dma-mapping: provide a benchmark for streaming DMA mapping

2020-11-15 Thread Barry Song
like the number of threads - make cache dirty before dma_map - fix unpaired dma_map_page and dma_unmap_single; - remove redundant "long long" before ktime_to_ns(); - use devm_add_action() Barry Song (2): dma-mapping: add benchmark support for streaming DMA APIs sel

[PATCH v4 2/2] selftests/dma: add test application for DMA_MAP_BENCHMARK

2020-11-15 Thread Barry Song
average map latency(us):1.1 standard deviation:1.9 average unmap latency(us):0.5 standard deviation:0.8 Cc: Will Deacon Cc: Shuah Khan Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Signed-off-by: Barry Song --- -v4: * add dma direction and mask_

[PATCH v2 1/2] dma-mapping: add benchmark support for streaming DMA APIs

2020-11-01 Thread Barry Song
/sys/bus/pci/devices/:00:01.0/driver_override echo :00:01.0 > /sys/bus/pci/drivers/xxx/unbind echo :00:01.0 > /sys/bus/pci/drivers/dma_map_benchmark/bind Cc: Joerg Roedel Cc: Will Deacon Cc: Shuah Khan Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Signed-off-by: B

[PATCH v2 0/2] dma-mapping: provide a benchmark for streaming DMA mapping

2020-11-01 Thread Barry Song
of threads - make cache dirty before dma_map - fix unpaired dma_map_page and dma_unmap_single; - remove redundant "long long" before ktime_to_ns(); - use devm_add_action(); - wakeup all threads together after they are ready Barry Song (2): dma-mapping: add benchma

[PATCH v2 2/2] selftests/dma: add test application for DMA_MAP_BENCHMARK

2020-11-01 Thread Barry Song
average map latency(us):1.1 standard deviation:1.9 average unmap latency(us):0.5 standard deviation:0.8 Cc: Joerg Roedel Cc: Will Deacon Cc: Shuah Khan Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Signed-off-by: Barry Song --- -v2: * check parameters like threads, second

[PATCH v3 1/2] dma-mapping: add benchmark support for streaming DMA APIs

2020-11-02 Thread Barry Song
/sys/bus/pci/devices/:00:01.0/driver_override echo :00:01.0 > /sys/bus/pci/drivers/xxx/unbind echo :00:01.0 > /sys/bus/pci/drivers/dma_map_benchmark/bind Cc: Joerg Roedel Cc: Will Deacon Cc: Shuah Khan Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Signed-off-by: B

[PATCH v3 0/2] dma-mapping: provide a benchmark for streaming DMA mapping

2020-11-02 Thread Barry Song
- check users' parameters strictly like the number of threads - make cache dirty before dma_map - fix unpaired dma_map_page and dma_unmap_single; - remove redundant "long long" before ktime_to_ns(); - use devm_add_action() Barry Song (2): dma-mapping: add benchma

[PATCH v3 2/2] selftests/dma: add test application for DMA_MAP_BENCHMARK

2020-11-02 Thread Barry Song
average map latency(us):1.1 standard deviation:1.9 average unmap latency(us):0.5 standard deviation:0.8 Cc: Joerg Roedel Cc: Will Deacon Cc: Shuah Khan Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Signed-off-by: Barry Song --- MAINTAINERS | 6

[PATCH v2] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-04 Thread Barry Song
unmap since the socket buffers come from OS. Simple RX model eg. disk driver, is also map -> RX -> unmap, but real RX model in a NIC could be more complicated considering packets can come spontaneously and many drivers are using pre-mapped buffers pool. This is in the TBD list. Signed-off-by: Ba

[PATCH] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-04 Thread Barry Song
-> transmission -> unmap. Transmission delay reduces the contention of IOMMU. Here a delay is added to simulate the transmission for TX case so that the tested result could be more accurate. RX case would be much more tricky. It is not supported yet. Signed-off-by: Barry Song --- kern

[PATCH v3 1/2] dma-mapping: benchmark: use u8 for reserved field in uAPI structure

2021-02-05 Thread Barry Song
in tools, otherwise, if users use old version to run on newer kernel, the random expansion value will cause side effect on newer kernel. Signed-off-by: Barry Song --- kernel/dma/map_benchmark.c | 2 +- tools/testing/selftests/dma/dma_map_benchmark.c | 4 +++- 2 files changed

[PATCH v3 2/2] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-05 Thread Barry Song
unmap since the socket buffers come from OS. Simple RX model eg. disk driver, is also map -> RX -> unmap, but real RX model in a NIC could be more complicated considering packets can come spontaneously and many drivers are using pre-mapped buffers pool. This is in the TBD list. Signed-off-by: Barry

[PATCH RESEND] dma-mapping: benchmark: fix kernel crash when dma_map_single fails

2021-01-24 Thread Barry Song
(f8626802) [ 48.112884] ---[ end trace d4890e21e75419d5 ]--- Signed-off-by: Barry Song --- kernel/dma/map_benchmark.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c index b1496e744c68..1b1b8ff875cb 100644

Re: [RFC 0/7] Support in-kernel DMA with PASID and SVA

2021-10-01 Thread Barry Song
On Sat, Oct 2, 2021 at 1:36 AM Jason Gunthorpe wrote: > > On Sat, Oct 02, 2021 at 01:24:54AM +1300, Barry Song wrote: > > > I assume KVA mode can avoid this iotlb flush as the device is using > > the page table of the kernel and sharing the whole kernel space. But > > w

Re: [RFC 0/7] Support in-kernel DMA with PASID and SVA

2021-10-01 Thread Barry Song
On Wed, Sep 22, 2021 at 5:14 PM Jacob Pan wrote: > > Hi Joerg/Jason/Christoph et all, > > The current in-kernel supervisor PASID support is based on the SVM/SVA > machinery in sva-lib. Kernel SVA is achieved by extending a special flag > to indicate the binding of the device and a page table

Re: [RFC 0/7] Support in-kernel DMA with PASID and SVA

2021-10-06 Thread Barry Song
On Tue, Oct 5, 2021 at 7:21 AM Jason Gunthorpe wrote: > > On Mon, Oct 04, 2021 at 09:40:03AM -0700, Jacob Pan wrote: > > Hi Barry, > > > > On Sat, 2 Oct 2021 01:45:59 +1300, Barry Song <21cn...@gmail.com> wrote: > > > > > > > > > >

Re: [RFC 0/7] Support in-kernel DMA with PASID and SVA

2021-10-07 Thread Barry Song
On Fri, Oct 8, 2021 at 12:32 AM Jason Gunthorpe wrote: > > On Thu, Oct 07, 2021 at 06:43:33PM +1300, Barry Song wrote: > > > So do we have a case where devices can directly access the kernel's data > > structure such as a list/graph/tree with pointers to a kernel

RE: [PATCH v2 0/2] iommu/arm-smmu-v3: Improve cmdq lock efficiency

2020-09-01 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org > [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of John Garry > Sent: Saturday, August 22, 2020 1:54 AM > To: w...@kernel.org; robin.mur...@arm.com > Cc: j...@8bytes.org; linux-arm-ker...@lists.infradead.org; >

RE: [PATCH v6 0/2] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-08-31 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org > [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of Christoph Hellwig > Sent: Friday, August 21, 2020 6:19 PM > To: Song Bao Hua (Barry Song) > Cc: h...@lst.de; m.szyprow...@samsung.com; robin.m

RE: [PATCH v4] iommu/arm-smmu-v3: permit users to disable msi polling

2020-08-18 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Wednesday, August 19, 2020 2:31 AM > To: Song Bao Hua (Barry Song) ; w...@kernel.org; > j...@8bytes.org > Cc: Zengtao (B) ; > iommu@lists.linux-foundation.org; linux-arm-ker..

RE: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Jean-Philippe Brucker [mailto:jean-phili...@linaro.org] > Sent: Friday, August 28, 2020 7:41 PM > To: Song Bao Hua (Barry Song) > Cc: iommu@lists.linux-foundation.org; linux-arm-ker...@lists.infradead.org; > robin.mur...@arm.com; w...@ke

RE: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Friday, August 28, 2020 11:18 PM > To: Song Bao Hua (Barry Song) ; Will Deacon > > Cc: iommu@lists.linux-foundation.org; linux-arm-ker...@lists.infradead.org; > j...@8bytes.org; Li

RE: [PATCH] iommu/arm-smmu-v3: add tracepoints for cmdq_issue_cmdlist

2020-08-28 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Will Deacon [mailto:w...@kernel.org] > Sent: Friday, August 28, 2020 10:29 PM > To: Song Bao Hua (Barry Song) > Cc: iommu@lists.linux-foundation.org; linux-arm-ker...@lists.infradead.org; > robin.mur...@arm.com; j...@8bytes.org; Linux

RE: [PATCH v6 1/2] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-21 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Will Deacon [mailto:w...@kernel.org] > Sent: Friday, August 21, 2020 8:47 PM > To: Song Bao Hua (Barry Song) > Cc: h...@lst.de; m.szyprow...@samsung.com; robin.mur...@arm.com; > ganapatrao.kulka...@cavium.com; catalin.mari...@arm.com; &

RE: [PATCH v6 1/2] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-21 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Will Deacon [mailto:w...@kernel.org] > Sent: Friday, August 21, 2020 9:27 PM > To: Song Bao Hua (Barry Song) > Cc: h...@lst.de; m.szyprow...@samsung.com; robin.mur...@arm.com; > ganapatrao.kulka...@cavium.com; catalin.mari...@arm.com; &

RE: [PATCH v7 0/3] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-08-21 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Mike Kravetz [mailto:mike.krav...@oracle.com] > Sent: Saturday, August 22, 2020 5:53 AM > To: Song Bao Hua (Barry Song) ; h...@lst.de; > m.szyprow...@samsung.com; robin.mur...@arm.com; w...@kernel.org; > ganapatrao.kulka...@cavium

RE: [PATCH v7 0/3] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-08-21 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Song Bao Hua (Barry Song) > Sent: Saturday, August 22, 2020 7:27 AM > To: 'Mike Kravetz' ; h...@lst.de; > m.szyprow...@samsung.com; robin.mur...@arm.com; w...@kernel.org; > ganapatrao.kulka...@cavium.com; catalin.mari...@arm.com; > a...

RE: [PATCH v7 1/3] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-21 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Mike Rapoport [mailto:r...@linux.ibm.com] > Sent: Saturday, August 22, 2020 2:28 AM > To: Song Bao Hua (Barry Song) > Cc: h...@lst.de; m.szyprow...@samsung.com; robin.mur...@arm.com; > w...@kernel.org; ganapatrao.kulka...@cavium.c

RE: [PATCH v7 1/3] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-21 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Randy Dunlap [mailto:rdun...@infradead.org] > Sent: Saturday, August 22, 2020 4:08 AM > To: Song Bao Hua (Barry Song) ; h...@lst.de; > m.szyprow...@samsung.com; robin.mur...@arm.com; w...@kernel.org; > ganapatrao.kulka...@cavium.com; catal

RE: [PATCH v6 1/2] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-21 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org > [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of Randy Dunlap > Sent: Friday, August 21, 2020 2:50 PM > To: Song Bao Hua (Barry Song) ; h...@lst.de; > m.szyprow...@samsung.com; robin

RE: arm-smmu-v3 high cpu usage for NVMe

2020-05-24 Thread Song Bao Hua (Barry Song)
> Subject: Re: arm-smmu-v3 high cpu usage for NVMe > > On 20/03/2020 10:41, John Garry wrote: > > + Barry, Alexandru > > >     PerfTop:   85864 irqs/sec  kernel:89.6%  exact:  0.0% lost: > > 0/34434 drop: > > 0/40116 [4000Hz cycles],  (all, 96 CPUs) > > >

RE: [PATCH] iommu/arm-smmu-v3: expose numa_node attribute to users in sysfs

2020-06-01 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Tuesday, June 2, 2020 1:14 AM > To: Song Bao Hua (Barry Song) ; w...@kernel.org; > h...@lst.de; m.szyprow...@samsung.com; iommu@lists.linux-foundation.org > Cc: Linuxa

[PATCH] iommu/arm-smmu-v3: allocate the memory of queues in local numa node

2020-06-01 Thread Song Bao Hua (Barry Song)
:16010101T02 TZOFFSETFROM:+1200 TZOFFSETTO:+1300 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=9 END:DAYLIGHT END:VTIMEZONE BEGIN:VEVENT ORGANIZER;CN=Song Bao Hua (Barry Song):MAILTO:song.bao@hisilicon.com ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=h...@lst.de :MAILTO:h

RE: [PATCH] driver core: platform: expose numa_node to users in sysfs

2020-06-02 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, June 2, 2020 6:11 PM > To: Song Bao Hua (Barry Song) > Cc: raf...@kernel.org; iommu@lists.linux-foundation.org; > linux-arm-ker...@lists.infradead.org; linux-ker...@vger.ke

RE: [PATCH] driver core: platform: expose numa_node to users in sysfs

2020-06-02 Thread Song Bao Hua (Barry Song)
> > > > On Tue, Jun 02, 2020 at 05:09:57AM +, Song Bao Hua (Barry Song) > wrote: > > > > > > > > > > Platform devices are NUMA? That's crazy, and feels like a total > > > > > abuse of platform devices and drivers that

RE: [PATCH] driver core: platform: expose numa_node to users in sysfs

2020-06-01 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, June 2, 2020 4:24 PM > To: Song Bao Hua (Barry Song) > Cc: raf...@kernel.org; iommu@lists.linux-foundation.org; > linux-arm-ker...@lists.infradead.org; linux-ker...@vger.ke

RE: [PATCH] driver core: platform: expose numa_node to users in sysfs

2020-06-01 Thread Song Bao Hua (Barry Song)
> > > > Platform devices are NUMA? That's crazy, and feels like a total abuse > > of platform devices and drivers that really should belong on a "real" > > bus. > > I am not sure if it is an abuse of platform device. But smmu is a platform > device, > drivers/iommu/arm-smmu-v3.c is a platform

RE: [PATCH] dma: Per-NUMA-node CMA should depend on NUMA

2020-10-26 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Tuesday, October 27, 2020 1:25 AM > To: h...@lst.de > Cc: iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.org; Song Bao > Hua (Barry Song) > Subject: [PATCH] dma: Per-NUMA-n

RE: [PATCH] dma: Per-NUMA-node CMA should depend on NUMA

2020-10-27 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: h...@lst.de [mailto:h...@lst.de] > Sent: Tuesday, October 27, 2020 8:55 PM > To: Song Bao Hua (Barry Song) > Cc: Robin Murphy ; h...@lst.de; > iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.org > Subject: Re: [PATCH] d

RE: [PATCH] iommu/arm-smmu-v3: remove the approach of MSI polling for CMD SYNC

2020-07-17 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Friday, July 17, 2020 8:55 PM > To: Song Bao Hua (Barry Song) ; w...@kernel.org; > j...@8bytes.org > Cc: linux-ker...@vger.kernel.org; Linuxarm ; > linux-arm-ker...@lists.infradead.o

RE: [PATCH v3] iommu/arm-smmu-v3: permit users to disable MSI polling

2020-08-03 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: John Garry > Sent: Tuesday, August 4, 2020 3:34 AM > To: Song Bao Hua (Barry Song) ; w...@kernel.org; > robin.mur...@arm.com; j...@8bytes.org; iommu@lists.linux-foundation.org > Cc: Zengtao (B) ; > linux-arm-ker...@lists.infradead.org >

RE: [PATCH v2] iommu/arm-smmu-v3: disable MSI polling if SEV polling is faster

2020-07-31 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: John Garry > Sent: Friday, July 31, 2020 10:21 PM > To: Song Bao Hua (Barry Song) ; w...@kernel.org; > robin.mur...@arm.com; j...@8bytes.org; iommu@lists.linux-foundation.org > Cc: Zengtao (B) ; Linuxarm > ; linux-arm-ker...@lists.infrad

RE: [PATCH v2] iommu/arm-smmu-v3: disable MSI polling if SEV polling is faster

2020-07-31 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Will Deacon [mailto:w...@kernel.org] > Sent: Saturday, August 1, 2020 12:22 AM > To: Song Bao Hua (Barry Song) > Cc: John Garry ; robin.mur...@arm.com; > j...@8bytes.org; iommu@lists.linux-foundation.org; Zengtao (B) > ; Linux

RE: [PATCH net] xsk: remove cheap_dma optimization

2020-07-08 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] > On Behalf Of Christoph Hellwig > Sent: Wednesday, July 8, 2020 6:50 PM > To: Robin Murphy > Cc: Björn Töpel ; Christoph Hellwig ; > Daniel Borkmann ; maxi...@mellanox.com; >

RE: [PATCH] iommu/arm-smmu-v3: expose numa_node attribute to users in sysfs

2020-07-05 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Will Deacon [mailto:w...@kernel.org] > Sent: Saturday, July 4, 2020 4:22 AM > To: Song Bao Hua (Barry Song) > Cc: robin.mur...@arm.com; h...@lst.de; m.szyprow...@samsung.com; > iommu@lists.linux-foundation.org; linux-arm-ker...@l

RE: [PATCH] iommu/arm-smmu-v3: allocate the memory of queues in local numa node

2020-07-05 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Will Deacon [mailto:w...@kernel.org] > Sent: Saturday, July 4, 2020 4:22 AM > To: Song Bao Hua (Barry Song) > Cc: h...@lst.de; m.szyprow...@samsung.com; robin.mur...@arm.com; > linux-arm-ker...@lists.infradead.org; iommu@lists.li

RE: [PATCH v3 0/2] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-07-12 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Song Bao Hua (Barry Song) > Sent: Sunday, June 28, 2020 11:13 PM > To: h...@lst.de; m.szyprow...@samsung.com; robin.mur...@arm.com; > w...@kernel.org; ganapatrao.kulka...@cavium.com; > catalin.mari...@arm.com > Cc: iommu@lists.linux-fou

RE: [PATCH v2 2/2] arm64: mm: reserve per-numa CMA after numa_init

2020-06-25 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Thursday, June 25, 2020 11:16 PM > To: Song Bao Hua (Barry Song) ; h...@lst.de; > m.szyprow...@samsung.com; w...@kernel.org; > ganapatrao.kulka...@cavium.com; catalin.mari...@arm.com >

RE: [PATCH v2 1/2] dma-direct: provide the ability to reserve per-numa CMA

2020-06-26 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org > [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of Robin Murphy > Sent: Thursday, June 25, 2020 11:11 PM > To: Song Bao Hua (Barry Song) ; h...@lst.de; > m.szyprow...@samsung.com; w...@kernel.org;

RE: [kbuild-all] Re: [PATCH 1/3] dma-direct: provide the ability to reserve per-numa CMA

2020-06-06 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Philip Li [mailto:philip...@intel.com] > Sent: Saturday, June 6, 2020 3:47 PM > To: Dan Carpenter > Cc: Song Bao Hua (Barry Song) ; > kbu...@lists.01.org; h...@lst.de; m.szyprow...@samsung.com; > robin.mur...@arm.com; catalin.mari...@ar

  1   2   >