diff options
-rw-r--r-- | arch/x86/mm/numa_64.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index e211c005f5e1..243d18d4cfde 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -63,12 +63,7 @@ static int __init populate_memnodemap(const struct bootnode *nodes, | |||
63 | do { | 63 | do { |
64 | if (memnodemap[addr >> shift] != NUMA_NO_NODE) | 64 | if (memnodemap[addr >> shift] != NUMA_NO_NODE) |
65 | return -1; | 65 | return -1; |
66 | 66 | memnodemap[addr >> shift] = nodeids[i]; | |
67 | if (!nodeids) | ||
68 | memnodemap[addr >> shift] = i; | ||
69 | else | ||
70 | memnodemap[addr >> shift] = nodeids[i]; | ||
71 | |||
72 | addr += (1UL << shift); | 67 | addr += (1UL << shift); |
73 | } while (addr < end); | 68 | } while (addr < end); |
74 | res = 1; | 69 | res = 1; |
@@ -706,6 +701,7 @@ static int __init split_nodes_size_interleave(u64 addr, u64 max_addr, u64 size) | |||
706 | static int __init numa_emulation(unsigned long start_pfn, | 701 | static int __init numa_emulation(unsigned long start_pfn, |
707 | unsigned long last_pfn, int acpi, int amd) | 702 | unsigned long last_pfn, int acpi, int amd) |
708 | { | 703 | { |
704 | static int nodeid[NR_NODE_MEMBLKS] __initdata; | ||
709 | u64 addr = start_pfn << PAGE_SHIFT; | 705 | u64 addr = start_pfn << PAGE_SHIFT; |
710 | u64 max_addr = last_pfn << PAGE_SHIFT; | 706 | u64 max_addr = last_pfn << PAGE_SHIFT; |
711 | int num_nodes; | 707 | int num_nodes; |
@@ -730,7 +726,11 @@ static int __init numa_emulation(unsigned long start_pfn, | |||
730 | 726 | ||
731 | if (num_nodes < 0) | 727 | if (num_nodes < 0) |
732 | return num_nodes; | 728 | return num_nodes; |
733 | memnode_shift = compute_hash_shift(nodes, num_nodes, NULL); | 729 | |
730 | for (i = 0; i < ARRAY_SIZE(nodeid); i++) | ||
731 | nodeid[i] = i; | ||
732 | |||
733 | memnode_shift = compute_hash_shift(nodes, num_nodes, nodeid); | ||
734 | if (memnode_shift < 0) { | 734 | if (memnode_shift < 0) { |
735 | memnode_shift = 0; | 735 | memnode_shift = 0; |
736 | printk(KERN_ERR "No NUMA hash function found. NUMA emulation " | 736 | printk(KERN_ERR "No NUMA hash function found. NUMA emulation " |