From 15b323d37e266e5321a88c8d3eae2932ba9fc4ee Mon Sep 17 00:00:00 2001 From: Mark Deneen Date: Thu, 6 May 2021 10:52:51 -0400 Subject: [PATCH] adjust CONFIG_FORCE_MAX_ZONEORDER from 15 to 11 for sama5 platform At 15 the kernel produces the following message at boot: [ 0.000000] cma: Failed to reserve 64 MiB When there is memory pressure and the OOM killer kills a process, something like this will be in the ring buffer: [222861.384895] Normal free:56424kB min:8192kB low:10240kB high:12288kB reserved_highatomic:65536KB active_anon:1440kB inactive_anon:28164kB active_file:260kB inactive_file:1888kB See the reserved_highatomic number? I'm pretty sure that the kernel reserves 64 MiB and that CMA buffers are carved out of that. When the CMA allocation fails, it does not appear to ever return this 64 MiB reserved memory and it is locked up forever. Changing FORCE_MAX_ZONEORDER from 15 to 11 allows CMA to reserve the space it needs and does not lock up memory in the reserved_highatomic space. --- arch/arm/configs/sama5_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig index f2ffafb090ea1d..64b32be539c32f 100644 --- a/arch/arm/configs/sama5_defconfig +++ b/arch/arm/configs/sama5_defconfig @@ -23,7 +23,7 @@ CONFIG_SOC_SAMA5D2=y CONFIG_SOC_SAMA5D3=y CONFIG_SOC_SAMA5D4=y # CONFIG_ATMEL_CLOCKSOURCE_PIT is not set -CONFIG_FORCE_MAX_ZONEORDER=15 +CONFIG_FORCE_MAX_ZONEORDER=11 CONFIG_UACCESS_WITH_MEMCPY=y # CONFIG_ATAGS is not set CONFIG_ZBOOT_ROM_TEXT=0x0