Skip to content

Commit 10971ab

Browse files
author
Ingo Molnar
committed
x86/mm: Further simplify 1 GB kernel linear mappings handling
It's a bit pointless to allow Kconfig configuration for 1GB kernel mappings, it's already hidden behind a 'default y' and CONFIG_EXPERT. Remove this complication and simplify the code by renaming CONFIG_ENABLE_DIRECT_GBPAGES to CONFIG_X86_DIRECT_GBPAGES and document the DEBUG_PAGE_ALLOC and KMEMCHECK quirks. Cc: Luis R. Rodriguez <mcgrof@suse.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Borislav Petkov <bp@suse.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: Dexuan Cui <decui@microsoft.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: JBeulich@suse.com Cc: Jan Beulich <JBeulich@suse.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Juergen Gross <jgross@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Lindgren <tony@atomide.com> Cc: Toshi Kani <toshi.kani@hp.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Xishi Qiu <qiuxishi@huawei.com> Cc: julia.lawall@lip6.fr Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 73c8c86 commit 10971ab

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

arch/x86/Kconfig

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,22 +1299,14 @@ config ARCH_DMA_ADDR_T_64BIT
12991299
def_bool y
13001300
depends on X86_64 || HIGHMEM64G
13011301

1302-
config ENABLE_DIRECT_GBPAGES
1302+
config X86_DIRECT_GBPAGES
13031303
def_bool y
13041304
depends on X86_64 && !DEBUG_PAGEALLOC && !KMEMCHECK
1305-
1306-
config DIRECT_GBPAGES
1307-
bool "Enable 1GB pages for kernel pagetables" if EXPERT
1308-
default y
1309-
depends on ENABLE_DIRECT_GBPAGES
1310-
---help---
1311-
Enable by default the kernel linear mapping to use 1GB pages on CPUs
1312-
that support it. This can improve the kernel's performance a tiny bit
1313-
by reducing TLB pressure. If in doubt, say "Y". If you've disabled
1314-
option but your platform is capable of handling support for this
1315-
you can use the gbpages kernel parameter. Likewise if you've enabled
1316-
this but you'd like to force disable this option you can use the
1317-
nogbpages kernel parameter.
1305+
---help---
1306+
Certain kernel features effectively disable kernel
1307+
linear 1 GB mappings (even if the CPU otherwise
1308+
supports them), so don't confuse the user by printing
1309+
that we have them enabled.
13181310

13191311
# Common NUMA Features
13201312
config NUMA

arch/x86/mm/init.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,10 @@ int after_bootmem;
133133

134134
static int page_size_mask;
135135

136-
early_param_on_off("gbpages", "nogbpages",
137-
direct_gbpages, CONFIG_DIRECT_GBPAGES);
136+
early_param_on_off("gbpages", "nogbpages", direct_gbpages, CONFIG_X86_DIRECT_GBPAGES);
138137

139138
static void __init init_gbpages(void)
140139
{
141-
if (!IS_ENABLED(CONFIG_ENABLE_DIRECT_GBPAGES)) {
142-
direct_gbpages = 0;
143-
return;
144-
}
145140
if (direct_gbpages && cpu_has_gbpages) {
146141
printk(KERN_INFO "Using GB pages for direct mapping\n");
147142
page_size_mask |= 1 << PG_LEVEL_1G;

0 commit comments

Comments
 (0)