From 6246d345f5505e8706cee3b1dfddc39f6079b4ea Mon Sep 17 00:00:00 2001 From: Juan Yescas Date: Thu, 12 Jun 2025 16:01:53 -0700 Subject: [PATCH] ANDROID: mm: Set PAGE_BLOCK_ORDER to 8 when ARM64_16K_PAGES This config will allow the 16kb page size kernels to have the same CMA_MIN_ALIGNMENT_BYTES that 4k kernels. This means that the CMA configs for the drivers won't have to change. Note: This change is needed to avoid breaking old kernel builds. Bug: 424212284 Bug: 375647879 Bug: 355449177 Bug: 418282543 Test: tools/bazel run //common:kernel_aarch64_dist tools/bazel run //common:kernel_aarch64_16k_dist tools/bazel run //common:kernel_x86_64_dist Change-Id: Icbfcab0d7e5ba18b3fc35c1186ef79e82f3e7ab1 Signed-off-by: Juan Yescas --- mm/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 4b97eb0aee01..0bf806c0813d 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -928,6 +928,13 @@ config CMA_AREAS config ARCH_FORCE_MAX_ORDER int +# +# Select this config option from the ARM64 architecture Kconfig to set +# the page size to 16KB. +# See b/424212284 for more information. +config ARM64_16K_PAGES + bool + # # When ARCH_FORCE_MAX_ORDER is not defined, # the default page block order is MAX_ORDER (10) as per @@ -937,6 +944,7 @@ config PAGE_BLOCK_ORDER int "Page Block Order" range 1 10 if ARCH_FORCE_MAX_ORDER = 0 || ARCH_FORCE_MAX_ORDER = "" default 10 if ARCH_FORCE_MAX_ORDER = 0 || ARCH_FORCE_MAX_ORDER = "" + default 8 if ARM64_16K_PAGES range 1 ARCH_FORCE_MAX_ORDER if ARCH_FORCE_MAX_ORDER != 0 default ARCH_FORCE_MAX_ORDER if ARCH_FORCE_MAX_ORDER != 0 help