[patch 4/4] x86_64 numa: fake apicid_to_node mapping for fake numa

From: David Rientjes
Date: Mon May 07 2007 - 12:35:44 EST


When we are in the emulated NUMA case, we need to make sure that all
existing apicid_to_node mappings that point to real node ID's now point
to the equivalent fake node ID's.

Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
---
arch/x86_64/mm/srat.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -472,7 +472,7 @@ static int __init find_node_by_addr(const struct bootnode *nodes,
*/
void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes)
{
- int i;
+ int i, j;

printk(KERN_INFO "Faking PXM affinity for fake nodes on real "
"topology.\n");
@@ -486,6 +486,13 @@ void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes)
if (nid == NUMA_NO_NODE)
continue;
__acpi_map_pxm_to_node(pxm, nid);
+ /*
+ * For each apicid-to-node mapping that exists for this real
+ * node, it must now point to the fake node ID.
+ */
+ for (j = 0; j < MAX_LOCAL_APIC; j++)
+ if (apicid_to_node[j] == i)
+ apicid_to_node[j] = nid;
}

nodes_clear(nodes_parsed);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/