]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86: add gbpages switches
authorIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:40:45 +0000 (17:40 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:40:45 +0000 (17:40 +0200)
These new controls toggle experimental support for a new CPU feature,
the straightforward extension of largepages from the pmd level to the
pud level, which allows 1GB (kernel) TLBs instead of 2MB TLBs.

Turn it off by default, as this code has not been tested well enough yet.

Use the CONFIG_DIRECT_GBPAGES=y .config option or gbpages on the
boot line can be used to enable it. If enabled in the .config then
nogbpages boot option disables it.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Documentation/x86_64/boot-options.txt
arch/x86/Kconfig.debug
arch/x86/mm/init_64.c
include/asm-x86/pgtable_64.h

index 34abae4e94427eabb76aa074f67efc2987f3b9f6..b0c7b6c4abda9362e38955dfee572a064dd6b992 100644 (file)
@@ -307,3 +307,8 @@ Debugging
                        stuck (default)
 
 Miscellaneous
+
+       nogbpages
+               Do not use GB pages for kernel direct mappings.
+       gbpages
+               Use GB pages for kernel direct mappings.
index 7ce8e702566182320554e82c52f87d9dfe97bf1a..f4413c04e687c16f0cf15973a4f100d2f62f203c 100644 (file)
@@ -76,6 +76,18 @@ config DEBUG_RODATA
          data. This is recommended so that we can catch kernel bugs sooner.
          If in doubt, say "Y".
 
+config DIRECT_GBPAGES
+       bool "Enable gbpages-mapped kernel pagetables"
+       depends on DEBUG_KERNEL && EXPERIMENTAL && X86_64
+       help
+         Enable gigabyte pages support (if the CPU supports it). This can
+         improve the kernel's performance a tiny bit by reducing TLB
+         pressure.
+
+         This is experimental code.
+
+         If in doubt, say "N".
+
 config DEBUG_RODATA_TEST
        bool "Testcase for the DEBUG_RODATA feature"
        depends on DEBUG_RODATA
index a02a14f0f324f9a3392810a46d587dfcda23a157..6e7d5a42a09ae19fa997aff8b104c3c9ffec3f04 100644 (file)
@@ -54,6 +54,26 @@ static unsigned long dma_reserve __initdata;
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
+int direct_gbpages __meminitdata
+#ifdef CONFIG_DIRECT_GBPAGES
+                               = 1
+#endif
+;
+
+static int __init parse_direct_gbpages_off(char *arg)
+{
+       direct_gbpages = 0;
+       return 0;
+}
+early_param("nogbpages", parse_direct_gbpages_off);
+
+static int __init parse_direct_gbpages_on(char *arg)
+{
+       direct_gbpages = 1;
+       return 0;
+}
+early_param("gbpages", parse_direct_gbpages_on);
+
 /*
  * NOTE: pagetable_init alloc all the fixmap pagetables contiguous on the
  * physical space so we can cache the place of the first one and move
index 01d2359e7a348a3a6817d57db2f769e95118fb13..6ef09914acbed8e218d5a1b9af68e9015c9fa798 100644 (file)
@@ -239,6 +239,8 @@ static inline int pud_large(pud_t pte)
 
 #define update_mmu_cache(vma,address,pte) do { } while (0)
 
+extern int direct_gbpages;
+
 /* Encode and de-code a swap entry */
 #define __swp_type(x)                  (((x).val >> 1) & 0x3f)
 #define __swp_offset(x)                        ((x).val >> 8)