aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/numa_64.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 16:27:50 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 16:27:50 -0500
commit3e01dfce1387f8bec41018f0d7b42fd88ad4163f (patch)
tree88223ad43e3afe6e0ebdec1f636a2d04975fdf9d /arch/x86/mm/numa_64.c
parent45f37e86f1ef95f002386d8a0ab508407cec9bf3 (diff)
parentd987402695f16ae33999d7315b915099d64616d4 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: x86: avoid section mismatch involving arch_register_cpu x86: fixes for lookup_address args x86: fix sparse warnings in cpu/common.c x86: make early_console static in early_printk.c x86: remove unneeded round_up x86: fix section mismatch warning in kernel/pci-calgary x86: fix section mismatch warning in acpi/boot.c x86: fix section mismatch warnings when referencing notifiers x86: silence section mismatch warning in smpboot_64.c x86: fix comments in vmlinux_64.lds x86_64: make bootmap_start page align v6 x86_64: add debug name for early_res
Diffstat (limited to 'arch/x86/mm/numa_64.c')
-rw-r--r--arch/x86/mm/numa_64.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index dc3b1f7e1451..a920d09b9194 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -84,26 +84,24 @@ static int __init populate_memnodemap(const struct bootnode *nodes,
84 84
85static int __init allocate_cachealigned_memnodemap(void) 85static int __init allocate_cachealigned_memnodemap(void)
86{ 86{
87 unsigned long pad, pad_addr; 87 unsigned long addr;
88 88
89 memnodemap = memnode.embedded_map; 89 memnodemap = memnode.embedded_map;
90 if (memnodemapsize <= ARRAY_SIZE(memnode.embedded_map)) 90 if (memnodemapsize <= ARRAY_SIZE(memnode.embedded_map))
91 return 0; 91 return 0;
92 92
93 pad = L1_CACHE_BYTES - 1; 93 addr = 0x8000;
94 pad_addr = 0x8000; 94 nodemap_size = round_up(sizeof(s16) * memnodemapsize, L1_CACHE_BYTES);
95 nodemap_size = pad + sizeof(s16) * memnodemapsize; 95 nodemap_addr = find_e820_area(addr, end_pfn<<PAGE_SHIFT,
96 nodemap_addr = find_e820_area(pad_addr, end_pfn<<PAGE_SHIFT, 96 nodemap_size, L1_CACHE_BYTES);
97 nodemap_size);
98 if (nodemap_addr == -1UL) { 97 if (nodemap_addr == -1UL) {
99 printk(KERN_ERR 98 printk(KERN_ERR
100 "NUMA: Unable to allocate Memory to Node hash map\n"); 99 "NUMA: Unable to allocate Memory to Node hash map\n");
101 nodemap_addr = nodemap_size = 0; 100 nodemap_addr = nodemap_size = 0;
102 return -1; 101 return -1;
103 } 102 }
104 pad_addr = (nodemap_addr + pad) & ~pad; 103 memnodemap = phys_to_virt(nodemap_addr);
105 memnodemap = phys_to_virt(pad_addr); 104 reserve_early(nodemap_addr, nodemap_addr + nodemap_size, "MEMNODEMAP");
106 reserve_early(nodemap_addr, nodemap_addr + nodemap_size);
107 105
108 printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n", 106 printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n",
109 nodemap_addr, nodemap_addr + nodemap_size); 107 nodemap_addr, nodemap_addr + nodemap_size);
@@ -164,15 +162,16 @@ int early_pfn_to_nid(unsigned long pfn)
164} 162}
165 163
166static void * __init early_node_mem(int nodeid, unsigned long start, 164static void * __init early_node_mem(int nodeid, unsigned long start,
167 unsigned long end, unsigned long size) 165 unsigned long end, unsigned long size,
166 unsigned long align)
168{ 167{
169 unsigned long mem = find_e820_area(start, end, size); 168 unsigned long mem = find_e820_area(start, end, size, align);
170 void *ptr; 169 void *ptr;
171 170
172 if (mem != -1L) 171 if (mem != -1L)
173 return __va(mem); 172 return __va(mem);
174 ptr = __alloc_bootmem_nopanic(size, 173
175 SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)); 174 ptr = __alloc_bootmem_nopanic(size, align, __pa(MAX_DMA_ADDRESS));
176 if (ptr == NULL) { 175 if (ptr == NULL) {
177 printk(KERN_ERR "Cannot find %lu bytes in node %d\n", 176 printk(KERN_ERR "Cannot find %lu bytes in node %d\n",
178 size, nodeid); 177 size, nodeid);
@@ -198,7 +197,8 @@ void __init setup_node_bootmem(int nodeid, unsigned long start,
198 start_pfn = start >> PAGE_SHIFT; 197 start_pfn = start >> PAGE_SHIFT;
199 end_pfn = end >> PAGE_SHIFT; 198 end_pfn = end >> PAGE_SHIFT;
200 199
201 node_data[nodeid] = early_node_mem(nodeid, start, end, pgdat_size); 200 node_data[nodeid] = early_node_mem(nodeid, start, end, pgdat_size,
201 SMP_CACHE_BYTES);
202 if (node_data[nodeid] == NULL) 202 if (node_data[nodeid] == NULL)
203 return; 203 return;
204 nodedata_phys = __pa(node_data[nodeid]); 204 nodedata_phys = __pa(node_data[nodeid]);
@@ -211,8 +211,12 @@ void __init setup_node_bootmem(int nodeid, unsigned long start,
211 /* Find a place for the bootmem map */ 211 /* Find a place for the bootmem map */
212 bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); 212 bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
213 bootmap_start = round_up(nodedata_phys + pgdat_size, PAGE_SIZE); 213 bootmap_start = round_up(nodedata_phys + pgdat_size, PAGE_SIZE);
214 /*
215 * SMP_CAHCE_BYTES could be enough, but init_bootmem_node like
216 * to use that to align to PAGE_SIZE
217 */
214 bootmap = early_node_mem(nodeid, bootmap_start, end, 218 bootmap = early_node_mem(nodeid, bootmap_start, end,
215 bootmap_pages<<PAGE_SHIFT); 219 bootmap_pages<<PAGE_SHIFT, PAGE_SIZE);
216 if (bootmap == NULL) { 220 if (bootmap == NULL) {
217 if (nodedata_phys < start || nodedata_phys >= end) 221 if (nodedata_phys < start || nodedata_phys >= end)
218 free_bootmem((unsigned long)node_data[nodeid], 222 free_bootmem((unsigned long)node_data[nodeid],