From: Steve Capper <steve.capper@linaro.org>
Date: Thu, 25 Apr 2013 14:19:21 +0000 (+0100)
Subject: ARM64: mm: Raise MAX_ORDER for 64KB pages and THP.
X-Git-Tag: firefly_0821_release~3680^2~114^2~1^2~10
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=74c50894f33d4bf349499e8f6ac75db3dd1ff3ff;p=firefly-linux-kernel-4.4.55.git

ARM64: mm: Raise MAX_ORDER for 64KB pages and THP.

The buddy allocator has a default MAX_ORDER of 11, which is too
low to allocate enough memory for 512MB Transparent HugePages if
our base page size is 64KB.

This patch introduces MAX_ZONE_ORDER and sets it to 14 when 64KB
pages are used in conjuction with THP, otherwise the default value
of 11 is used.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
---

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index cd6eca84a21c..10607d63b945 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -191,6 +191,11 @@ config ARCH_WANT_HUGE_PMD_SHARE
 
 source "mm/Kconfig"
 
+config FORCE_MAX_ZONEORDER
+	int
+	default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
+	default "11"
+
 endmenu
 
 menu "Boot options"