Re: [PATCH v2] swiotlb: introduce Kconfig option for compile-time default pool size
From: Marek Szyprowski
Date: Tue Aug 04 2026 - 02:53:11 EST
On 02.07.2026 16:09, bibek.patro@xxxxxxxxxxxxxxxx wrote:
> From: Jagadeesh Pagadala <jpagadal@xxxxxxxxxxxxxxxx>
>
> The SWIOTLB bounce buffer pool size is hardcoded at 64 MB via
> IO_TLB_DEFAULT_SIZE with no compile-time knob to adjust it. On
> memory-constrained embedded or mobile platforms equipped with a
> hardware IOMMU (e.g., ARM SMMU) covering most DMA-capable devices,
> reserving 64 MB at boot is unnecessarily wasteful — the SWIOTLB is
> only exercised for devices that bypass the IOMMU or have restricted
> DMA address ranges.
>
> Introduce CONFIG_SWIOTLB_DEFAULT_SIZE_MB, an integer Kconfig option
> (range 1–64 MB, default 64) that allows platforms to set a smaller
> compile-time default. IO_TLB_DEFAULT_SIZE is updated to derive from
> this value when CONFIG_SWIOTLB is enabled, preserving the existing
> 64 MB default when the option is not configured.
>
> The runtime "swiotlb=<nslabs>" kernel parameter override remains
> fully supported and takes precedence over the compile-time default.
>
> Signed-off-by: Jagadeesh Pagadala <jpagadal@xxxxxxxxxxxxxxxx>
> Signed-off-by: Bibek Kumar Patro <bibek.patro@xxxxxxxxxxxxxxxx>
Applied to dma-mapping-for-next, thanks!
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland