aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/numa.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2007-07-21 11:10:32 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-21 21:37:10 -0400
commit3484d79813707bb6045773953a809abba443dc20 (patch)
treea986c674698face8fc51132a1feeac53fa7946a2 /drivers/acpi/numa.c
parent3af044e0f832cfa3fcdce14dc30678b79dd36995 (diff)
x86_64: fake pxm-to-node mapping for fake numa
For NUMA emulation, our SLIT should represent the true NUMA topology of the system but our proximity domain to node ID mapping needs to reflect the emulated state. When NUMA emulation has successfully setup fake nodes on the system, a new function, acpi_fake_nodes() is called. This function determines the proximity domain (_PXM) for each true node found on the system. It then finds which emulated nodes have been allocated on this true node as determined by its starting address. The node ID to PXM mapping is changed so that each fake node ID points to the PXM of the true node that it is located on. If the machine failed to register a SLIT, then we assume there is no special requirement for emulated node affinity so we use the default LOCAL_DISTANCE, which is newly exported to this code, as our measurement if the emulated nodes appear in the same PXM. Otherwise, we use REMOTE_DISTANCE. PXM_INVAL and NID_INVAL are also exported to the ACPI header file so that we can compare node_to_pxm() results in generic code (in this case, the SRAT code). Cc: Len Brown <lenb@kernel.org> Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/acpi/numa.c')
-rw-r--r--drivers/acpi/numa.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 6c44b522f4d3..ab04d848b19d 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -36,8 +36,6 @@
36ACPI_MODULE_NAME("numa"); 36ACPI_MODULE_NAME("numa");
37 37
38static nodemask_t nodes_found_map = NODE_MASK_NONE; 38static nodemask_t nodes_found_map = NODE_MASK_NONE;
39#define PXM_INVAL -1
40#define NID_INVAL -1
41 39
42/* maps to convert between proximity domain and logical node ID */ 40/* maps to convert between proximity domain and logical node ID */
43static int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS] 41static int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS]
@@ -59,6 +57,12 @@ int node_to_pxm(int node)
59 return node_to_pxm_map[node]; 57 return node_to_pxm_map[node];
60} 58}
61 59
60void __acpi_map_pxm_to_node(int pxm, int node)
61{
62 pxm_to_node_map[pxm] = node;
63 node_to_pxm_map[node] = pxm;
64}
65
62int acpi_map_pxm_to_node(int pxm) 66int acpi_map_pxm_to_node(int pxm)
63{ 67{
64 int node = pxm_to_node_map[pxm]; 68 int node = pxm_to_node_map[pxm];
@@ -67,8 +71,7 @@ int acpi_map_pxm_to_node(int pxm)
67 if (nodes_weight(nodes_found_map) >= MAX_NUMNODES) 71 if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
68 return NID_INVAL; 72 return NID_INVAL;
69 node = first_unset_node(nodes_found_map); 73 node = first_unset_node(nodes_found_map);
70 pxm_to_node_map[pxm] = node; 74 __acpi_map_pxm_to_node(pxm, node);
71 node_to_pxm_map[node] = pxm;
72 node_set(node, nodes_found_map); 75 node_set(node, nodes_found_map);
73 } 76 }
74 77