[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250418073026.2418728-9-huaqian.li@siemens.com>
Date: Fri, 18 Apr 2025 15:30:26 +0800
From: huaqian.li@...mens.com
To: helgaas@...nel.org,
m.szyprowski@...sung.com,
robin.murphy@....com
Cc: baocheng.su@...mens.com,
bhelgaas@...gle.com,
conor+dt@...nel.org,
devicetree@...r.kernel.org,
diogo.ivo@...mens.com,
huaqian.li@...mens.com,
jan.kiszka@...mens.com,
kristo@...nel.org,
krzk+dt@...nel.org,
kw@...ux.com,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org,
lpieralisi@...nel.org,
nm@...com,
robh@...nel.org,
s-vadapalli@...com,
ssantosh@...nel.org,
vigneshr@...com,
iommu@...ts.linux.dev
Subject: [PATCH v7 8/8] swiotlb: Make IO_TLB_SEGSIZE configurable
From: Li Hua Qian <huaqian.li@...mens.com>
In some applications, the default value of 128 is not sufficient for
memory allocation and can cause runtime errors. This change makes
IO_TLB_SEGSIZE configurable, allowing it to be increased if needed.
Signed-off-by: Li Hua Qian <huaqian.li@...mens.com>
---
include/linux/swiotlb.h | 2 +-
kernel/dma/Kconfig | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 3dae0f592063..145c71f8329d 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -23,7 +23,7 @@ struct scatterlist;
* must be a power of 2. What is the appropriate value ?
* The complexity of {map,unmap}_single is linearly dependent on this value.
*/
-#define IO_TLB_SEGSIZE 128
+#define IO_TLB_SEGSIZE CONFIG_SWIOTLB_SEGSIZE
/*
* log of the size of each IO TLB slab. The number of slabs is command line
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 31cfdb6b4bc3..38bfa84b96b6 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -102,6 +102,13 @@ config SWIOTLB_DYNAMIC
If unsure, say N.
+config SWIOTLB_SEGSIZE
+ int "SWIOTLB segment size"
+ default 128
+ help
+ Set the maximum allowable number of contiguous slabs to map.
+ Must be a power of 2.
+
config DMA_BOUNCE_UNALIGNED_KMALLOC
bool
depends on SWIOTLB
--
2.34.1
Powered by blists - more mailing lists