Skip to contentSkip to conversation

x86-64, NUMA: Revert NUMA affine page table allocation

PATCH New Tejun Heo 1 participant 1 message Mar 4, 2011

Subsystems (2)
lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 x86-64, NUMA: Revert NUMA affine page table allocation

Quoted 1 line

From f89112502805c1f6a6955f90ad158e538edb319d Mon Sep 17 00:00:00 2001

Date: Fri, 4 Mar 2011 10:26:36 +0100

This patch reverts NUMA affine page table allocation added by commit 1411e0ec31 (x86-64, numa: Put pgtable to local node memory).

The commit made an undocumented change where the kernel linear mapping strictly follows intersection of e820 memory map and NUMA configuration. If the physical memory configuration has holes or NUMA nodes are not properly aligned, this leads to using unnecessarily smaller mapping size which leads to increased TLB pressure. For details,

http://thread.gmane.org/gmane.linux.kernel/1104672

Patches to fix the problem have been proposed but the underlying code needs more cleanup and the approach itself seems a bit heavy handed and it has been determined to revert the feature for now and come back to it in the next developement cycle.

http://thread.gmane.org/gmane.linux.kernel/1105959

As init_memory_mapping_high() callsites have been consolidated since the commit, reverting is done manually. Also, the RED-PEN comment in arch/x86/mm/init.c is not restored as the problem no longer exists with memblock based top-down early memory allocation.

Cc Yinghai Lu <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/include/asm/page_types.h |    2 -
 arch/x86/kernel/setup.c           |    8 +++++
 arch/x86/mm/init_64.c             |   54 -------------------------------------
 arch/x86/mm/numa_64.c             |    2 -
 4 files changed, 8 insertions(+), 58 deletions(-)
arch/x86/include/asm/page_types.h +0 -2
index 97e6007..bce688d 100644
@@ -54,8 +54,6 @@ static inline phys_addr_t get_max_mapped(void)
 extern unsigned long init_memory_mapping(unsigned long start,
 					 unsigned long end);
 
-void init_memory_mapping_high(void);
-
 extern void initmem_init(void);
 extern void free_initmem(void);
 
arch/x86/kernel/setup.c +8 -0
index 46e684f..c3a606c 100644
@@ -963,6 +963,14 @@ void __init setup_arch(char **cmdline_p)
 	max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT);
 	max_pfn_mapped = max_low_pfn_mapped;
 
+#ifdef CONFIG_X86_64
+	if (max_pfn > max_low_pfn) {
+		max_pfn_mapped = init_memory_mapping(1UL<<32,
+						     max_pfn<<PAGE_SHIFT);
+		/* can we preseve max_low_pfn ?*/
+		max_low_pfn = max_pfn;
+	}
+#endif
 	memblock.current_limit = get_max_mapped();
 
 	/*
arch/x86/mm/init_64.c +0 -54

63 lines not on this page · raw message

arch/x86/mm/numa_64.c +0 -2
index 74064e8..86491ba 100644
@@ -543,8 +543,6 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
 	if (!numa_meminfo_cover_memory(mi))
 		return -EINVAL;
 
-	init_memory_mapping_high();
-
 	/* Finally register nodes. */
 	for_each_node_mask(nid, node_possible_map) {
 		u64 start = (u64)max_pfn << PAGE_SHIFT;
Signature · 1 line
1.7.1