[PATCH] arm64: swiotlb: Reduce the default size if no ZONE_DMA bouncing needed

Catalin Marinas catalin.marinas at arm.com
Fri Oct 13 11:45:18 PDT 2023


On Fri, 06 Oct 2023 16:32:52 +0100, Catalin Marinas wrote:
> With CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC enabled, the arm64 kernel still
> allocates the default SWIOTLB buffer (64MB) even if ZONE_DMA is disabled
> or all the RAM fits into this zone. However, this potentially wastes a
> non-negligible amount of memory on platforms with little RAM.
> 
> Reduce the SWIOTLB size to 1MB per 1GB of RAM if only needed for
> kmalloc() buffer bouncing.
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

Also changed the division to DIV_ROUND_UP() as per Robin's suggestion.

[1/1] arm64: swiotlb: Reduce the default size if no ZONE_DMA bouncing needed
      https://git.kernel.org/arm64/c/65033574ade9

-- 
Catalin




More information about the linux-arm-kernel mailing list