From 45afa562802ae9a253ef437dd0010c8c2ec17806 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 7 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 2b86f4fd9abd..48ee73e3ec59 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1001,6 +1001,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_PAGE_ORDER (10) as per @@ -1010,6 +1017,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 7 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