View | Details | Raw Unified | Return to bug 148014
Collapse All | Expand All

(-)linux-2.6.15/arch/x86_64/mm/numa.c (+5 lines)
Lines 143-148 void __init setup_node_bootmem(int nodei Link Here
143
143
144
	reserve_bootmem_node(NODE_DATA(nodeid), nodedata_phys, pgdat_size); 
144
	reserve_bootmem_node(NODE_DATA(nodeid), nodedata_phys, pgdat_size); 
145
	reserve_bootmem_node(NODE_DATA(nodeid), bootmap_start, bootmap_pages<<PAGE_SHIFT);
145
	reserve_bootmem_node(NODE_DATA(nodeid), bootmap_start, bootmap_pages<<PAGE_SHIFT);
146
#ifdef CONFIG_ACPI_NUMA
147
	srat_reserve_add_area(nodeid);
148
#endif
146
	node_set_online(nodeid);
149
	node_set_online(nodeid);
147
} 
150
} 
148
151
Lines 326-331 __init int numa_setup(char *opt) Link Here
326
#ifdef CONFIG_ACPI_NUMA
329
#ifdef CONFIG_ACPI_NUMA
327
 	if (!strncmp(opt,"noacpi",6))
330
 	if (!strncmp(opt,"noacpi",6))
328
 		acpi_numa = -1;
331
 		acpi_numa = -1;
332
	if (!strncmp(opt,"ignorehotadd",13))
333
		ignore_hotadd = 1;
329
#endif
334
#endif
330
	return 1;
335
	return 1;
331
} 
336
} 
(-)linux-2.6.15/arch/x86_64/mm/srat.c (-5 / +64 lines)
Lines 15-20 Link Here
15
#include <linux/bitmap.h>
15
#include <linux/bitmap.h>
16
#include <linux/module.h>
16
#include <linux/module.h>
17
#include <linux/topology.h>
17
#include <linux/topology.h>
18
#include <linux/bootmem.h>
19
#include <linux/mm.h>
18
#include <asm/proto.h>
20
#include <asm/proto.h>
19
#include <asm/numa.h>
21
#include <asm/numa.h>
20
#include <asm/e820.h>
22
#include <asm/e820.h>
Lines 24-29 static struct acpi_table_slit *acpi_slit Link Here
24
static nodemask_t nodes_parsed __initdata;
26
static nodemask_t nodes_parsed __initdata;
25
static nodemask_t nodes_found __initdata;
27
static nodemask_t nodes_found __initdata;
26
static struct node nodes[MAX_NUMNODES] __initdata;
28
static struct node nodes[MAX_NUMNODES] __initdata;
29
struct node nodes_add[MAX_NUMNODES] __initdata;
30
static int found_add_area __initdata;
31
int ignore_hotadd __initdata;
27
static u8 pxm2node[256] = { [0 ... 255] = 0xff };
32
static u8 pxm2node[256] = { [0 ... 255] = 0xff };
28
33
29
/* Too small nodes confuse the VM badly. Usually they result
34
/* Too small nodes confuse the VM badly. Usually they result
Lines 90-95 static __init void bad_srat(void) Link Here
90
	acpi_numa = -1;
95
	acpi_numa = -1;
91
	for (i = 0; i < MAX_LOCAL_APIC; i++)
96
	for (i = 0; i < MAX_LOCAL_APIC; i++)
92
		apicid_to_node[i] = NUMA_NO_NODE;
97
		apicid_to_node[i] = NUMA_NO_NODE;
98
	for (i = 0; i < MAX_NUMNODES; i++)
99
		nodes_add[i].start = nodes[i].end = 0;
93
}
100
}
94
101
95
static __init inline int srat_disabled(void)
102
static __init inline int srat_disabled(void)
Lines 181-190 acpi_numa_memory_affinity_init(struct ac Link Here
181
		bad_srat();
188
		bad_srat();
182
		return;
189
		return;
183
	}
190
	}
184
	/* It is fine to add this area to the nodes data it will be used later*/
185
	if (ma->flags.hot_pluggable == 1)
186
		printk(KERN_INFO "SRAT: hot plug zone found %lx - %lx \n",
187
				start, end);
188
	i = conflicting_nodes(start, end);
191
	i = conflicting_nodes(start, end);
189
	if (i == node) {
192
	if (i == node) {
190
		printk(KERN_WARNING
193
		printk(KERN_WARNING
Lines 208-213 acpi_numa_memory_affinity_init(struct ac Link Here
208
		if (nd->end < end)
211
		if (nd->end < end)
209
			nd->end = end;
212
			nd->end = end;
210
	}
213
	}
214
215
 	/*
216
 	 * It is fine to add this area to the nodes data it will be used later
217
 	 * This code supports one contigious hot add area per node.
218
 	 * The signed cast is intentional to catch underflows.
219
 	 */
220
 	if (ma->flags.hot_pluggable == 1 && !ignore_hotadd) {
221
		unsigned long s_pfn = start >> PAGE_SHIFT;
222
		unsigned long e_pfn = end >> PAGE_SHIFT;
223
224
		/* Sorry guys - if you want working memory hotplug write correct SRATs */
225
		if ((signed long)(end - start) < NODE_MIN_SIZE ||
226
		    e820_hole_size(s_pfn, e_pfn) != e_pfn - s_pfn) { 
227
			printk(KERN_ERR 
228
	"SRAT: Hotplug area %lx-%lx too small or overlaps with real memory\n",
229
				start, end);
230
			bad_srat();
231
			return;
232
		}
233
234
 		found_add_area = 1;
235
 		if (nodes_add[node].start == nodes_add[node].end) {
236
 			nodes_add[node].start = start;
237
 			nodes_add[node].end = end;
238
 		} else {
239
 			if (nodes_add[node].start == end)
240
 				nodes_add[node].start = start;
241
 			if (nodes_add[node].end == start)
242
 				nodes_add[node].end = end;
243
 		}
244
 		if ((nodes_add[node].end >> PAGE_SHIFT) > end_pfn)
245
 			end_pfn = nodes_add[node].end >> PAGE_SHIFT;
246
 		printk(KERN_INFO "SRAT: hot plug zone found %Lx - %Lx\n",
247
 				nodes_add[node].start, nodes_add[node].end);
248
 	}
249
211
	printk(KERN_INFO "SRAT: Node %u PXM %u %Lx-%Lx\n", node, pxm,
250
	printk(KERN_INFO "SRAT: Node %u PXM %u %Lx-%Lx\n", node, pxm,
212
	       nd->start, nd->end);
251
	       nd->start, nd->end);
213
}
252
}
Lines 225-230 static int nodes_cover_memory(void) Link Here
225
		unsigned long e = nodes[i].end >> PAGE_SHIFT;
264
		unsigned long e = nodes[i].end >> PAGE_SHIFT;
226
		pxmram += e - s;
265
		pxmram += e - s;
227
		pxmram -= e820_hole_size(s, e);
266
		pxmram -= e820_hole_size(s, e);
267
		pxmram -= nodes_add[i].end - nodes_add[i].start;
268
		if ((long)pxmram < 0)
269
			pxmram = 0;
228
	}
270
	}
229
271
230
	e820ram = end_pfn - e820_hole_size(0, end_pfn);
272
	e820ram = end_pfn - e820_hole_size(0, end_pfn);
Lines 258-264 int __init acpi_scan_nodes(unsigned long Link Here
258
300
259
	/* First clean up the node list */
301
	/* First clean up the node list */
260
	for (i = 0; i < MAX_NUMNODES; i++) {
302
	for (i = 0; i < MAX_NUMNODES; i++) {
261
		cutoff_node(i, start, end);
303
 		if (!found_add_area)
304
 			cutoff_node(i, start, end);
262
		if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE)
305
		if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE)
263
			unparse_node(i);
306
			unparse_node(i);
264
	}
307
	}
Lines 303-308 static int node_to_pxm(int n) Link Here
303
       return 0;
346
       return 0;
304
}
347
}
305
348
349
void __init srat_reserve_add_area(int nodeid)
350
{
351
	if (found_add_area && nodes_add[nodeid].end) {
352
		printk(KERN_INFO 
353
	"SRAT: Reserving hot-add memory space for node %d at %Lx-%Lx\n", 
354
			nodeid, nodes_add[nodeid].start, nodes_add[nodeid].end);
355
		printk(KERN_INFO 
356
	"SRAT: This will cost you %Lu MB of pre-allocated memory.\n", 
357
		(((nodes_add[nodeid].end - 
358
			nodes_add[nodeid].start)/PAGE_SIZE)*sizeof(struct page)) >> 20);
359
360
		reserve_bootmem_node(NODE_DATA(nodeid), nodes_add[nodeid].start,
361
			       nodes_add[nodeid].end - nodes_add[nodeid].start);
362
	}
363
}
364
306
int __node_distance(int a, int b)
365
int __node_distance(int a, int b)
307
{
366
{
308
	int index;
367
	int index;
(-)linux-2.6.15/include/asm-x86_64/numa.h (+2 lines)
Lines 18-23 extern void numa_init_array(void); Link Here
18
extern int numa_off;
18
extern int numa_off;
19
19
20
extern void numa_set_node(int cpu, int node);
20
extern void numa_set_node(int cpu, int node);
21
extern void srat_reserve_add_area(int nodeid);
22
extern int ignore_hotadd;
21
23
22
extern unsigned char apicid_to_node[256];
24
extern unsigned char apicid_to_node[256];
23
#ifdef CONFIG_NUMA
25
#ifdef CONFIG_NUMA
(-)linux-2.6.15/Documentation/x86_64/boot-options.txt (+3 lines)
Lines 151-156 NUMA Link Here
151
151
152
  numa=fake=X   Fake X nodes and ignore NUMA setup of the actual machine.
152
  numa=fake=X   Fake X nodes and ignore NUMA setup of the actual machine.
153
153
154
  numa=ignorehotadd Ignore hot add memory in SRAT. This will disable memory
155
                hotplug      [SUSE extension for now]
156
154
ACPI
157
ACPI
155
158
156
  acpi=off	Don't enable ACPI
159
  acpi=off	Don't enable ACPI
(-)linux-2.6.15/arch/x86_64/mm/init.c (-1 lines)
Lines 479-485 void __init clear_kernel_mapping(unsigne Link Here
479
479
480
/*
480
/*
481
 * Memory hotplug specific functions
481
 * Memory hotplug specific functions
482
 * These are only for non-NUMA machines right now.
483
 */
482
 */
484
#ifdef CONFIG_ACPI_HOTPLUG_MEMORY
483
#ifdef CONFIG_ACPI_HOTPLUG_MEMORY
485
484

Return to bug 148014