aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/numa_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/numa_64.c')
-rw-r--r--arch/x86/mm/numa_64.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 6e4fbd777564..8b1f178a866e 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -37,7 +37,6 @@ struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
37EXPORT_SYMBOL(node_data); 37EXPORT_SYMBOL(node_data);
38 38
39nodemask_t numa_nodes_parsed __initdata; 39nodemask_t numa_nodes_parsed __initdata;
40nodemask_t mem_nodes_parsed __initdata;
41 40
42struct memnode memnode; 41struct memnode memnode;
43 42
@@ -344,6 +343,20 @@ static int __init numa_cleanup_meminfo(struct numa_meminfo *mi)
344} 343}
345 344
346/* 345/*
346 * Set nodes, which have memory in @mi, in *@nodemask.
347 */
348static void __init numa_nodemask_from_meminfo(nodemask_t *nodemask,
349 const struct numa_meminfo *mi)
350{
351 int i;
352
353 for (i = 0; i < ARRAY_SIZE(mi->blk); i++)
354 if (mi->blk[i].start != mi->blk[i].end &&
355 mi->blk[i].nid != NUMA_NO_NODE)
356 node_set(mi->blk[i].nid, *nodemask);
357}
358
359/*
347 * Sanity check to catch more bad NUMA configurations (they are amazingly 360 * Sanity check to catch more bad NUMA configurations (they are amazingly
348 * common). Make sure the nodes cover all memory. 361 * common). Make sure the nodes cover all memory.
349 */ 362 */
@@ -379,7 +392,8 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
379 int i, j, nid; 392 int i, j, nid;
380 393
381 /* Account for nodes with cpus and no memory */ 394 /* Account for nodes with cpus and no memory */
382 nodes_or(node_possible_map, mem_nodes_parsed, numa_nodes_parsed); 395 node_possible_map = numa_nodes_parsed;
396 numa_nodemask_from_meminfo(&node_possible_map, mi);
383 if (WARN_ON(nodes_empty(node_possible_map))) 397 if (WARN_ON(nodes_empty(node_possible_map)))
384 return -EINVAL; 398 return -EINVAL;
385 399
@@ -824,7 +838,6 @@ static int dummy_numa_init(void)
824 0LU, max_pfn << PAGE_SHIFT); 838 0LU, max_pfn << PAGE_SHIFT);
825 839
826 node_set(0, numa_nodes_parsed); 840 node_set(0, numa_nodes_parsed);
827 node_set(0, mem_nodes_parsed);
828 numa_add_memblk(0, 0, (u64)max_pfn << PAGE_SHIFT); 841 numa_add_memblk(0, 0, (u64)max_pfn << PAGE_SHIFT);
829 842
830 return 0; 843 return 0;
@@ -852,7 +865,6 @@ void __init initmem_init(void)
852 set_apicid_to_node(j, NUMA_NO_NODE); 865 set_apicid_to_node(j, NUMA_NO_NODE);
853 866
854 nodes_clear(numa_nodes_parsed); 867 nodes_clear(numa_nodes_parsed);
855 nodes_clear(mem_nodes_parsed);
856 nodes_clear(node_possible_map); 868 nodes_clear(node_possible_map);
857 nodes_clear(node_online_map); 869 nodes_clear(node_online_map);
858 memset(&numa_meminfo, 0, sizeof(numa_meminfo)); 870 memset(&numa_meminfo, 0, sizeof(numa_meminfo));