Commit c0e28959 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] [3/4] x86_64: Fix NUMA hash setup

Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ee3dae22
......@@ -148,7 +148,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
if (!found)
return -1;
memnode_shift = compute_hash_shift(nodes);
memnode_shift = compute_hash_shift(nodes, numnodes);
if (memnode_shift < 0) {
printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n");
return -1;
......
......@@ -34,9 +34,7 @@ cpumask_t node_to_cpumask[MAX_NUMNODES];
int numa_off __initdata;
unsigned long nodes_present;
int __init compute_hash_shift(struct node *nodes)
int __init compute_hash_shift(struct node *nodes, int numnodes)
{
int i;
int shift = 24;
......@@ -45,7 +43,7 @@ int __init compute_hash_shift(struct node *nodes)
/* When in doubt use brute force. */
while (shift < 48) {
memset(memnodemap,0xff,sizeof(*memnodemap) * NODEMAPSIZE);
for_each_online_node(i) {
for (i = 0; i < numnodes; i++) {
if (nodes[i].start == nodes[i].end)
continue;
for (addr = nodes[i].start;
......@@ -197,7 +195,7 @@ static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn)
(nodes[i].end - nodes[i].start) >> 20);
node_set_online(i);
}
memnode_shift = compute_hash_shift(nodes);
memnode_shift = compute_hash_shift(nodes, numa_fake);
if (memnode_shift < 0) {
memnode_shift = 0;
printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\n");
......
......@@ -166,7 +166,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
int i;
if (acpi_numa <= 0)
return -1;
memnode_shift = compute_hash_shift(nodes);
memnode_shift = compute_hash_shift(nodes, nodes_weight(nodes_parsed));
if (memnode_shift < 0) {
printk(KERN_ERR
"SRAT: No NUMA node hash function found. Contact maintainer\n");
......
......@@ -8,7 +8,7 @@ struct node {
u64 start,end;
};
extern int compute_hash_shift(struct node *nodes);
extern int compute_hash_shift(struct node *nodes, int numnodes);
#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment