a1dfc257ae
ZONE_DMA32 is enabled by default, yet it is not
needed for all devices, nor is it desirable to have if not needed. For
instance, if a partner in GKI 1.0 did not use ZONE_DMA32, memory can
be lower for ZONE_NORMAL relative to older targets, such that memory
would run out more quickly in ZONE_NORMAL leading kswapd to be invoked
unnecessarily.
Correspondingly, provide a means of making ZONE_DMA32 empty via the
kernel command line when it is compiled in via CONFIG_ZONE_DMA32.
P.S. The following two patches are squashed into this one,
1. bf96382 ("ANDROID: dma-direct: Make DMA32 disablement work for CONFIG_NUMA")
2. 135406c ("ANDROID: dma-direct: Document disable_dma32")
Additionally, for kernels 6.6+, ensure that arm64_dma_phys_limit
is set correctly by letting it be set to the highest possible
physical address when disable_dma32 is present on the kernel
command line.
This allows SWIOTLB allocations to be satisfied from anywhere within
the physical memory space, as opposed to restricting these
allocations to the lower 32-bit addressable physical memory space.
It is important that SWIOTLB allocations use the correct addressing
limits, as SWIOTLB buffers can now be allocated at runtime--not just
boot. Using the correct addressing limits can help increase the amount
of memory available for SWIOTLB allocations, increasing the likelihood
of success.
This also aligns the behavior of disable_dma32 to what would happen if
CONFIG_ZONE_DMA32 were disabled.
Bug: 199917449
Bug: 268587627
Bug: 296282294
Bug: 372371001
Change-Id: I70ec76914b92e518d61a61072f0b3cb41cb28646
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
Signed-off-by: Sudarshan Rajagopalan <quic_sudaraja@quicinc.com>
Signed-off-by: Chinwen Chang <chinwen.chang@mediatek.com>
[isaacmanjarres: Updated commit message to note that this
version of the patch treats arm64_phys_dma_limit differently
than the original version of the patch.]
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
Signed-off-by: Chinwen Chang <chinwen.chang@mediatek.com>
7.6 KiB
7.6 KiB