diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-05-15 16:59:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-18 03:21:04 -0400 |
commit | 7c43769a9776141ec23ca81a1bdd5a9c0512f165 (patch) | |
tree | e24d99a84d76386b0bf910152d1841853857e63f /arch/x86/mm/srat_64.c | |
parent | 888a589f6be07d624e21e2174d98375e9f95911b (diff) |
x86, mm: Fix node_possible_map logic
Recently there were some changes to the meaning of node_possible_map,
and it is quite strange:
- the node without memory would be set in node_possible_map
- but some node with less NODE_MIN_SIZE will be kicked out of node_possible_map.
fix it by adding strict_setup_node_bootmem().
Also, remove unparse_node().
so result will be:
1. cpu_to_node() will return online node only (nearest one)
2. apicid_to_node() still returns the node that could be not online but is set
in node_possible_map.
3. node_possible_map will include nodes that mem on it are less NODE_MIN_SIZE
v2: after move_cpus_to_node change.
[ Impact: get node_possible_map right ]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Tested-by: Jack Steiner <steiner@sgi.com>
LKML-Reference: <4A0C49BE.6080800@kernel.org>
[ v3: various small cleanups and comment clarifications ]
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.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index b0dbbd48e58a..2dfcbf9df2ae 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -36,10 +36,6 @@ static int num_node_memblks __initdata; | |||
36 | static struct bootnode node_memblk_range[NR_NODE_MEMBLKS] __initdata; | 36 | static struct bootnode node_memblk_range[NR_NODE_MEMBLKS] __initdata; |
37 | static int memblk_nodeid[NR_NODE_MEMBLKS] __initdata; | 37 | static int memblk_nodeid[NR_NODE_MEMBLKS] __initdata; |
38 | 38 | ||
39 | /* Too small nodes confuse the VM badly. Usually they result | ||
40 | from BIOS bugs. */ | ||
41 | #define NODE_MIN_SIZE (4*1024*1024) | ||
42 | |||
43 | static __init int setup_node(int pxm) | 39 | static __init int setup_node(int pxm) |
44 | { | 40 | { |
45 | return acpi_map_pxm_to_node(pxm); | 41 | return acpi_map_pxm_to_node(pxm); |
@@ -338,17 +334,6 @@ static int __init nodes_cover_memory(const struct bootnode *nodes) | |||
338 | return 1; | 334 | return 1; |
339 | } | 335 | } |
340 | 336 | ||
341 | static void __init unparse_node(int node) | ||
342 | { | ||
343 | int i; | ||
344 | node_clear(node, nodes_parsed); | ||
345 | node_clear(node, cpu_nodes_parsed); | ||
346 | for (i = 0; i < MAX_LOCAL_APIC; i++) { | ||
347 | if (apicid_to_node[i] == node) | ||
348 | apicid_to_node[i] = NUMA_NO_NODE; | ||
349 | } | ||
350 | } | ||
351 | |||
352 | void __init acpi_numa_arch_fixup(void) {} | 337 | void __init acpi_numa_arch_fixup(void) {} |
353 | 338 | ||
354 | /* Use the information discovered above to actually set up the nodes. */ | 339 | /* Use the information discovered above to actually set up the nodes. */ |
@@ -360,18 +345,8 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
360 | return -1; | 345 | return -1; |
361 | 346 | ||
362 | /* First clean up the node list */ | 347 | /* First clean up the node list */ |
363 | for (i = 0; i < MAX_NUMNODES; i++) { | 348 | for (i = 0; i < MAX_NUMNODES; i++) |
364 | cutoff_node(i, start, end); | 349 | cutoff_node(i, start, end); |
365 | /* | ||
366 | * don't confuse VM with a node that doesn't have the | ||
367 | * minimum memory. | ||
368 | */ | ||
369 | if (nodes[i].end && | ||
370 | (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) { | ||
371 | unparse_node(i); | ||
372 | node_set_offline(i); | ||
373 | } | ||
374 | } | ||
375 | 350 | ||
376 | if (!nodes_cover_memory(nodes)) { | 351 | if (!nodes_cover_memory(nodes)) { |
377 | bad_srat(); | 352 | bad_srat(); |
@@ -404,7 +379,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
404 | 379 | ||
405 | if (node == NUMA_NO_NODE) | 380 | if (node == NUMA_NO_NODE) |
406 | continue; | 381 | continue; |
407 | if (!node_isset(node, node_possible_map)) | 382 | if (!node_online(node)) |
408 | numa_clear_node(i); | 383 | numa_clear_node(i); |
409 | } | 384 | } |
410 | numa_init_array(); | 385 | numa_init_array(); |