linux-mips
[Top] [All Lists]

[PATCH] MIPS: Handle huge pages with 64KB base page size.

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH] MIPS: Handle huge pages with 64KB base page size.
From: David Daney <ddaney.cavm@gmail.com>
Date: Fri, 4 May 2012 11:09:35 -0700
Cc: David Daney <david.daney@cavium.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=SIYEbHq1F/sEi2Nk2Jp2TVmFgUqxcSDRKy+0QiGeaHY=; b=i3p1NbKYLaeOV7YuBPU3OodrPCcXhB7VEpXCKh1V6xo45ntysopb6L9uUBxBuhYvXg N2rjdGo/I6HuKZdtsqxrnOfh2Nc1K/OJMimsiXKbRtR6Kpe2LR1lp5jsDufZcIcRRn0W m83GKGdhm8rEdza0Ez9KlQfiAviEPJ8OptdBkYAS3da/eaij0l9DdlLZxJ9FeJTV6kxb Y7bYhK+b2mnwXWecrCDZI5dNgpCvfopkekUVmLq8MyqGvJPOPvykKrFkq+DxSIx3nUQO bQRap+UJrLEiIm2WhhRrg53COup/8oDJ9jFIEkgJOVpKsIZ5rqKxDSJArVDEp7DVDMyy Uo9w==
Sender: linux-mips-bounce@linux-mips.org
From: David Daney <david.daney@cavium.com>

When using sparsemem, we need to adjust some constants as the
resulting huge pages are 512MB in size.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 arch/mips/Kconfig                 |   10 ++++++----
 arch/mips/include/asm/sparsemem.h |    6 +++++-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 3134457..e588610 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1789,10 +1789,12 @@ endchoice
 
 config FORCE_MAX_ZONEORDER
        int "Maximum zone order"
-       range 13 64 if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_32KB
-       default "13" if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_32KB
-       range 12 64 if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_16KB
-       default "12" if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_16KB
+       range 14 64 if HUGETLB_PAGE && PAGE_SIZE_64KB
+       default "14" if HUGETLB_PAGE && PAGE_SIZE_64KB
+       range 13 64 if HUGETLB_PAGE && PAGE_SIZE_32KB
+       default "13" if HUGETLB_PAGE && PAGE_SIZE_32KB
+       range 12 64 if HUGETLB_PAGE && PAGE_SIZE_16KB
+       default "12" if HUGETLB_PAGE && PAGE_SIZE_16KB
        range 11 64
        default "11"
        help
diff --git a/arch/mips/include/asm/sparsemem.h 
b/arch/mips/include/asm/sparsemem.h
index 7165333..4461198 100644
--- a/arch/mips/include/asm/sparsemem.h
+++ b/arch/mips/include/asm/sparsemem.h
@@ -6,7 +6,11 @@
  * SECTION_SIZE_BITS           2^N: how big each section will be
  * MAX_PHYSMEM_BITS            2^N: how much memory we can have in that space
  */
-#define SECTION_SIZE_BITS       28
+#if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_PAGE_SIZE_64KB)
+# define SECTION_SIZE_BITS     29
+#else
+# define SECTION_SIZE_BITS     28
+#endif
 #define MAX_PHYSMEM_BITS        35
 
 #endif /* CONFIG_SPARSEMEM */
-- 
1.7.2.3


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: Handle huge pages with 64KB base page size., David Daney <=