Re: [PATCH] [PATCH] ARM64: Setup DMA32 zone size by bootargs

From: Catalin Marinas
Date: Wed Sep 16 2020 - 15:07:00 EST

On Wed, Sep 16, 2020 at 09:33:24PM +0800, Phil Chang wrote:
> this patch allowing the DMA32 zone be configurable in ARM64.
> For some devices, the main memory split into 2 part due to the memory
> architecture, the efficient and less inefficient part.
> One of the use case is fine-tune the dma32 size to contain all the
> efficient part of memory block on this kind of architecture
> Signed-off-by: Alix Wu <alix.wu@xxxxxxxxxxxx>
> Signed-off-by: YJ Chiang <yj.chiang@xxxxxxxxxxxx>
> Signed-off-by: Phil Chang <phil.chang@xxxxxxxxxxxx>
> ---
> Hi
> supplement the reason of this usage.

That's really not a good enough justification to merge such patch. As
Christoph said, DMA32 is defined as addressing the first 4GB of RAM.

Is the memory inefficient (presumably slow) for device or for the CPU?
Maybe you can pretend it's a separate NUMA node for the CPU.
Alternatively, change your device DMA coherent mask and allocate only
from ZONE_DMA (currently first 1GB on arm64).