Re: [PATCH] arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER

From: Catalin Marinas
Date: Mon Mar 01 2021 - 10:18:57 EST


On Mon, Mar 01, 2021 at 04:55:14PM +0530, Anshuman Khandual wrote:
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 9cd33c7be429..d4690326274a 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1156,8 +1156,8 @@ config XEN
>
> config FORCE_MAX_ZONEORDER
> int
> - default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
> - default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE)
> + default "14" if ARM64_64K_PAGES
> + default "12" if ARM64_16K_PAGES
> default "11"
> help
> The kernel memory allocator divides physically contiguous memory

I think this makes sense. The original "14" was added by Steve C in
commit d03bb1455f3a ("ARM64: mm: Raise MAX_ORDER for 64KB pages and
THP.") back in 3.11. It looks like hugetlbfs (and the HUGETLB_PAGE_ORDER
definition) was added in the same kernel but we somehow missed the
!TRANSPARENT_HUGEPAGE case and smaller page order. The warning in
__fragmentation_index() was added much later in 4.14.

Anyway, the patch looks fine to me, we could apply it to some past
stable kernels:

Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx>

An alternative would have be to add a dependency on both
TRANSPARENT_HUGEPAGE and HUGETLB_PAGE but I'm not sure it's worth it.

--
Catalin