aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/srat_64.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-05-15 16:59:37 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-18 03:13:31 -0400
commit888a589f6be07d624e21e2174d98375e9f95911b (patch)
tree5c2c210796a114479807f41fc15fe69805d66074 /arch/x86/mm/srat_64.c
parentb286e21868ea1af724a7a4802da2c8e144fa70de (diff)
mm, x86: remove MEMORY_HOTPLUG_RESERVE related code
after: | commit b263295dbffd33b0fbff670720fa178c30e3392a | Author: Christoph Lameter <clameter@sgi.com> | Date: Wed Jan 30 13:30:47 2008 +0100 | | x86: 64-bit, make sparsemem vmemmap the only memory model we don't have MEMORY_HOTPLUG_RESERVE anymore. Historically, x86-64 had an architecture-specific method for memory hotplug whereby it scanned the SRAT for physical memory ranges that could be potentially used for memory hot-add later. By reserving those ranges without physical memory, the memmap would be allocated and left dormant until needed. This depended on the DISCONTIG memory model which has been removed so the code implementing HOTPLUG_RESERVE is now dead. This patch removes the dead code used by MEMORY_HOTPLUG_RESERVE. (Changelog authored by Mel.) v2: updated changelog, and remove hotadd= in doc [ Impact: remove dead code ] Signed-off-by: Yinghai Lu <yinghai@kernel.org> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Reviewed-by: Mel Gorman <mel@csn.ul.ie> Workflow-found-OK-by: Andrew Morton <akpm@linux-foundation.org> LKML-Reference: <4A0C4910.7090508@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/srat_64.c')
-rw-r--r--arch/x86/mm/srat_64.c63
1 files changed, 12 insertions, 51 deletions
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 87b45bff250..b0dbbd48e58 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -31,8 +31,6 @@ static nodemask_t nodes_parsed __initdata;
31static nodemask_t cpu_nodes_parsed __initdata; 31static nodemask_t cpu_nodes_parsed __initdata;
32static struct bootnode nodes[MAX_NUMNODES] __initdata; 32static struct bootnode nodes[MAX_NUMNODES] __initdata;
33static struct bootnode nodes_add[MAX_NUMNODES]; 33static struct bootnode nodes_add[MAX_NUMNODES];
34static int found_add_area __initdata;
35int hotadd_percent __initdata = 0;
36 34
37static int num_node_memblks __initdata; 35static int num_node_memblks __initdata;
38static struct bootnode node_memblk_range[NR_NODE_MEMBLKS] __initdata; 36static struct bootnode node_memblk_range[NR_NODE_MEMBLKS] __initdata;
@@ -66,9 +64,6 @@ static __init void cutoff_node(int i, unsigned long start, unsigned long end)
66{ 64{
67 struct bootnode *nd = &nodes[i]; 65 struct bootnode *nd = &nodes[i];
68 66
69 if (found_add_area)
70 return;
71
72 if (nd->start < start) { 67 if (nd->start < start) {
73 nd->start = start; 68 nd->start = start;
74 if (nd->end < nd->start) 69 if (nd->end < nd->start)
@@ -86,7 +81,6 @@ static __init void bad_srat(void)
86 int i; 81 int i;
87 printk(KERN_ERR "SRAT: SRAT not used.\n"); 82 printk(KERN_ERR "SRAT: SRAT not used.\n");
88 acpi_numa = -1; 83 acpi_numa = -1;
89 found_add_area = 0;
90 for (i = 0; i < MAX_LOCAL_APIC; i++) 84 for (i = 0; i < MAX_LOCAL_APIC; i++)
91 apicid_to_node[i] = NUMA_NO_NODE; 85 apicid_to_node[i] = NUMA_NO_NODE;
92 for (i = 0; i < MAX_NUMNODES; i++) 86 for (i = 0; i < MAX_NUMNODES; i++)
@@ -182,24 +176,21 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
182 pxm, apic_id, node); 176 pxm, apic_id, node);
183} 177}
184 178
185static int update_end_of_memory(unsigned long end) {return -1;}
186static int hotadd_enough_memory(struct bootnode *nd) {return 1;}
187#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE 179#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
188static inline int save_add_info(void) {return 1;} 180static inline int save_add_info(void) {return 1;}
189#else 181#else
190static inline int save_add_info(void) {return 0;} 182static inline int save_add_info(void) {return 0;}
191#endif 183#endif
192/* 184/*
193 * Update nodes_add and decide if to include add are in the zone. 185 * Update nodes_add[]
194 * Both SPARSE and RESERVE need nodes_add information. 186 * This code supports one contiguous hot add area per node
195 * This code supports one contiguous hot add area per node.
196 */ 187 */
197static int __init 188static void __init
198reserve_hotadd(int node, unsigned long start, unsigned long end) 189update_nodes_add(int node, unsigned long start, unsigned long end)
199{ 190{
200 unsigned long s_pfn = start >> PAGE_SHIFT; 191 unsigned long s_pfn = start >> PAGE_SHIFT;
201 unsigned long e_pfn = end >> PAGE_SHIFT; 192 unsigned long e_pfn = end >> PAGE_SHIFT;
202 int ret = 0, changed = 0; 193 int changed = 0;
203 struct bootnode *nd = &nodes_add[node]; 194 struct bootnode *nd = &nodes_add[node];
204 195
205 /* I had some trouble with strange memory hotadd regions breaking 196 /* I had some trouble with strange memory hotadd regions breaking
@@ -210,7 +201,7 @@ reserve_hotadd(int node, unsigned long start, unsigned long end)
210 mistakes */ 201 mistakes */
211 if ((signed long)(end - start) < NODE_MIN_SIZE) { 202 if ((signed long)(end - start) < NODE_MIN_SIZE) {
212 printk(KERN_ERR "SRAT: Hotplug area too small\n"); 203 printk(KERN_ERR "SRAT: Hotplug area too small\n");
213 return -1; 204 return;
214 } 205 }
215 206
216 /* This check might be a bit too strict, but I'm keeping it for now. */ 207 /* This check might be a bit too strict, but I'm keeping it for now. */
@@ -218,12 +209,7 @@ reserve_hotadd(int node, unsigned long start, unsigned long end)
218 printk(KERN_ERR 209 printk(KERN_ERR
219 "SRAT: Hotplug area %lu -> %lu has existing memory\n", 210 "SRAT: Hotplug area %lu -> %lu has existing memory\n",
220 s_pfn, e_pfn); 211 s_pfn, e_pfn);
221 return -1; 212 return;
222 }
223
224 if (!hotadd_enough_memory(&nodes_add[node])) {
225 printk(KERN_ERR "SRAT: Hotplug area too large\n");
226 return -1;
227 } 213 }
228 214
229 /* Looks good */ 215 /* Looks good */
@@ -245,11 +231,9 @@ reserve_hotadd(int node, unsigned long start, unsigned long end)
245 printk(KERN_ERR "SRAT: Hotplug zone not continuous. Partly ignored\n"); 231 printk(KERN_ERR "SRAT: Hotplug zone not continuous. Partly ignored\n");
246 } 232 }
247 233
248 ret = update_end_of_memory(nd->end);
249
250 if (changed) 234 if (changed)
251 printk(KERN_INFO "SRAT: hot plug zone found %Lx - %Lx\n", nd->start, nd->end); 235 printk(KERN_INFO "SRAT: hot plug zone found %Lx - %Lx\n",
252 return ret; 236 nd->start, nd->end);
253} 237}
254 238
255/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ 239/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
@@ -310,13 +294,10 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
310 start, end); 294 start, end);
311 e820_register_active_regions(node, start >> PAGE_SHIFT, 295 e820_register_active_regions(node, start >> PAGE_SHIFT,
312 end >> PAGE_SHIFT); 296 end >> PAGE_SHIFT);
313 push_node_boundaries(node, nd->start >> PAGE_SHIFT,
314 nd->end >> PAGE_SHIFT);
315 297
316 if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && 298 if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
317 (reserve_hotadd(node, start, end) < 0)) { 299 update_nodes_add(node, start, end);
318 /* Ignore hotadd region. Undo damage */ 300 /* restore nodes[node] */
319 printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
320 *nd = oldnode; 301 *nd = oldnode;
321 if ((nd->start | nd->end) == 0) 302 if ((nd->start | nd->end) == 0)
322 node_clear(node, nodes_parsed); 303 node_clear(node, nodes_parsed);
@@ -510,26 +491,6 @@ static int null_slit_node_compare(int a, int b)
510} 491}
511#endif /* CONFIG_NUMA_EMU */ 492#endif /* CONFIG_NUMA_EMU */
512 493
513void __init srat_reserve_add_area(int nodeid)
514{
515 if (found_add_area && nodes_add[nodeid].end) {
516 u64 total_mb;
517
518 printk(KERN_INFO "SRAT: Reserving hot-add memory space "
519 "for node %d at %Lx-%Lx\n",
520 nodeid, nodes_add[nodeid].start, nodes_add[nodeid].end);
521 total_mb = (nodes_add[nodeid].end - nodes_add[nodeid].start)
522 >> PAGE_SHIFT;
523 total_mb *= sizeof(struct page);
524 total_mb >>= 20;
525 printk(KERN_INFO "SRAT: This will cost you %Lu MB of "
526 "pre-allocated memory.\n", (unsigned long long)total_mb);
527 reserve_bootmem_node(NODE_DATA(nodeid), nodes_add[nodeid].start,
528 nodes_add[nodeid].end - nodes_add[nodeid].start,
529 BOOTMEM_DEFAULT);
530 }
531}
532
533int __node_distance(int a, int b) 494int __node_distance(int a, int b)
534{ 495{
535 int index; 496 int index;