[PATCH v5 22/22] x86, mm, numa: Put pagetable on local node ram for 64bit
If node with ram is hotplugable, local node mem for page table and vmemmap should be on that node ram. This patch is some kind of refreshment of | commit 1411e0ec3123ae4c4ead6bfc9fe3ee5a3ae5c327 | Date: Mon Dec 27 16:48:17 2010 -0800 | |x86-64, numa: Put pgtable to local node memory That was reverted before. We have reason to reintroduce it to make memory hotplug work. Calling init_mem_mapping in early_initmem_init for every node. alloc_low_pages will alloc page table in following order: BRK, local node, low range So page table will be on low range or local nodes. Signed-off-by: Yinghai Lu Cc: Pekka Enberg Cc: Jacob Shin Cc: Konrad Rzeszutek Wilk Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/numa.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 9b18ee8..5adf803 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -670,7 +670,39 @@ static void __init early_x86_numa_init(void) #ifdef CONFIG_X86_64 static void __init early_x86_numa_init_mapping(void) { - init_mem_mapping(0, max_pfn << PAGE_SHIFT); + unsigned long last_start = 0, last_end = 0; + struct numa_meminfo *mi = _meminfo; + unsigned long start, end; + int last_nid = -1; + int i, nid; + + for (i = 0; i < mi->nr_blks; i++) { + nid = mi->blk[i].nid; + start = mi->blk[i].start; + end = mi->blk[i].end; + + if (last_nid == nid) { + last_end = end; + continue; + } + + /* other nid now */ + if (last_nid >= 0) { + printk(KERN_DEBUG "Node %d: [mem %#016lx-%#016lx]\n", + last_nid, last_start, last_end - 1); + init_mem_mapping(last_start, last_end); + } + + /* for next nid */ + last_nid = nid; + last_start = start; + last_end = end; + } + /* last one */ + printk(KERN_DEBUG "Node %d: [mem %#016lx-%#016lx]\n", + last_nid, last_start, last_end - 1); + init_mem_mapping(last_start, last_end); + if (max_pfn > max_low_pfn) max_low_pfn = max_pfn; } -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v5 22/22] x86, mm, numa: Put pagetable on local node ram for 64bit
If node with ram is hotplugable, local node mem for page table and vmemmap should be on that node ram. This patch is some kind of refreshment of | commit 1411e0ec3123ae4c4ead6bfc9fe3ee5a3ae5c327 | Date: Mon Dec 27 16:48:17 2010 -0800 | |x86-64, numa: Put pgtable to local node memory That was reverted before. We have reason to reintroduce it to make memory hotplug work. Calling init_mem_mapping in early_initmem_init for every node. alloc_low_pages will alloc page table in following order: BRK, local node, low range So page table will be on low range or local nodes. Signed-off-by: Yinghai Lu ying...@kernel.org Cc: Pekka Enberg penb...@kernel.org Cc: Jacob Shin jacob.s...@amd.com Cc: Konrad Rzeszutek Wilk konrad.w...@oracle.com Reviewed-by: Tang Chen tangc...@cn.fujitsu.com Tested-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/mm/numa.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 9b18ee8..5adf803 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -670,7 +670,39 @@ static void __init early_x86_numa_init(void) #ifdef CONFIG_X86_64 static void __init early_x86_numa_init_mapping(void) { - init_mem_mapping(0, max_pfn PAGE_SHIFT); + unsigned long last_start = 0, last_end = 0; + struct numa_meminfo *mi = numa_meminfo; + unsigned long start, end; + int last_nid = -1; + int i, nid; + + for (i = 0; i mi-nr_blks; i++) { + nid = mi-blk[i].nid; + start = mi-blk[i].start; + end = mi-blk[i].end; + + if (last_nid == nid) { + last_end = end; + continue; + } + + /* other nid now */ + if (last_nid = 0) { + printk(KERN_DEBUG Node %d: [mem %#016lx-%#016lx]\n, + last_nid, last_start, last_end - 1); + init_mem_mapping(last_start, last_end); + } + + /* for next nid */ + last_nid = nid; + last_start = start; + last_end = end; + } + /* last one */ + printk(KERN_DEBUG Node %d: [mem %#016lx-%#016lx]\n, + last_nid, last_start, last_end - 1); + init_mem_mapping(last_start, last_end); + if (max_pfn max_low_pfn) max_low_pfn = max_pfn; } -- 1.8.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Part1 PATCH v5 22/22] x86, mm, numa: Put pagetable on local node ram for 64bit
From: Yinghai Lu If node with ram is hotplugable, memory for local node page table and vmemmap should be on the local node ram. This patch is some kind of refreshment of | commit 1411e0ec3123ae4c4ead6bfc9fe3ee5a3ae5c327 | Date: Mon Dec 27 16:48:17 2010 -0800 | |x86-64, numa: Put pgtable to local node memory That was reverted before. We have reason to reintroduce it to improve performance when using memory hotplug. Calling init_mem_mapping() in early_initmem_init() for each node. alloc_low_pages() will allocate page table in following order: BRK, local node, low range So page table will be on low range or local nodes. Signed-off-by: Yinghai Lu Cc: Pekka Enberg Cc: Jacob Shin Cc: Konrad Rzeszutek Wilk Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/numa.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 9b18ee8..5adf803 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -670,7 +670,39 @@ static void __init early_x86_numa_init(void) #ifdef CONFIG_X86_64 static void __init early_x86_numa_init_mapping(void) { - init_mem_mapping(0, max_pfn << PAGE_SHIFT); + unsigned long last_start = 0, last_end = 0; + struct numa_meminfo *mi = _meminfo; + unsigned long start, end; + int last_nid = -1; + int i, nid; + + for (i = 0; i < mi->nr_blks; i++) { + nid = mi->blk[i].nid; + start = mi->blk[i].start; + end = mi->blk[i].end; + + if (last_nid == nid) { + last_end = end; + continue; + } + + /* other nid now */ + if (last_nid >= 0) { + printk(KERN_DEBUG "Node %d: [mem %#016lx-%#016lx]\n", + last_nid, last_start, last_end - 1); + init_mem_mapping(last_start, last_end); + } + + /* for next nid */ + last_nid = nid; + last_start = start; + last_end = end; + } + /* last one */ + printk(KERN_DEBUG "Node %d: [mem %#016lx-%#016lx]\n", + last_nid, last_start, last_end - 1); + init_mem_mapping(last_start, last_end); + if (max_pfn > max_low_pfn) max_low_pfn = max_pfn; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Part1 PATCH v5 22/22] x86, mm, numa: Put pagetable on local node ram for 64bit
From: Yinghai Lu ying...@kernel.org If node with ram is hotplugable, memory for local node page table and vmemmap should be on the local node ram. This patch is some kind of refreshment of | commit 1411e0ec3123ae4c4ead6bfc9fe3ee5a3ae5c327 | Date: Mon Dec 27 16:48:17 2010 -0800 | |x86-64, numa: Put pgtable to local node memory That was reverted before. We have reason to reintroduce it to improve performance when using memory hotplug. Calling init_mem_mapping() in early_initmem_init() for each node. alloc_low_pages() will allocate page table in following order: BRK, local node, low range So page table will be on low range or local nodes. Signed-off-by: Yinghai Lu ying...@kernel.org Cc: Pekka Enberg penb...@kernel.org Cc: Jacob Shin jacob.s...@amd.com Cc: Konrad Rzeszutek Wilk konrad.w...@oracle.com Reviewed-by: Tang Chen tangc...@cn.fujitsu.com Tested-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/mm/numa.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 9b18ee8..5adf803 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -670,7 +670,39 @@ static void __init early_x86_numa_init(void) #ifdef CONFIG_X86_64 static void __init early_x86_numa_init_mapping(void) { - init_mem_mapping(0, max_pfn PAGE_SHIFT); + unsigned long last_start = 0, last_end = 0; + struct numa_meminfo *mi = numa_meminfo; + unsigned long start, end; + int last_nid = -1; + int i, nid; + + for (i = 0; i mi-nr_blks; i++) { + nid = mi-blk[i].nid; + start = mi-blk[i].start; + end = mi-blk[i].end; + + if (last_nid == nid) { + last_end = end; + continue; + } + + /* other nid now */ + if (last_nid = 0) { + printk(KERN_DEBUG Node %d: [mem %#016lx-%#016lx]\n, + last_nid, last_start, last_end - 1); + init_mem_mapping(last_start, last_end); + } + + /* for next nid */ + last_nid = nid; + last_start = start; + last_end = end; + } + /* last one */ + printk(KERN_DEBUG Node %d: [mem %#016lx-%#016lx]\n, + last_nid, last_start, last_end - 1); + init_mem_mapping(last_start, last_end); + if (max_pfn max_low_pfn) max_low_pfn = max_pfn; } -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/