aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/numa.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/acpi/numa.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/acpi/numa.c')
-rw-r--r--drivers/acpi/numa.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 202dd0c976a3..b0337d314604 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -28,6 +28,7 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/errno.h> 29#include <linux/errno.h>
30#include <linux/acpi.h> 30#include <linux/acpi.h>
31#include <linux/numa.h>
31#include <acpi/acpi_bus.h> 32#include <acpi/acpi_bus.h>
32 33
33#define PREFIX "ACPI: " 34#define PREFIX "ACPI: "
@@ -40,14 +41,14 @@ static nodemask_t nodes_found_map = NODE_MASK_NONE;
40 41
41/* maps to convert between proximity domain and logical node ID */ 42/* maps to convert between proximity domain and logical node ID */
42static int pxm_to_node_map[MAX_PXM_DOMAINS] 43static int pxm_to_node_map[MAX_PXM_DOMAINS]
43 = { [0 ... MAX_PXM_DOMAINS - 1] = NID_INVAL }; 44 = { [0 ... MAX_PXM_DOMAINS - 1] = NUMA_NO_NODE };
44static int node_to_pxm_map[MAX_NUMNODES] 45static int node_to_pxm_map[MAX_NUMNODES]
45 = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; 46 = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };
46 47
47int pxm_to_node(int pxm) 48int pxm_to_node(int pxm)
48{ 49{
49 if (pxm < 0) 50 if (pxm < 0)
50 return NID_INVAL; 51 return NUMA_NO_NODE;
51 return pxm_to_node_map[pxm]; 52 return pxm_to_node_map[pxm];
52} 53}
53 54
@@ -60,17 +61,19 @@ int node_to_pxm(int node)
60 61
61void __acpi_map_pxm_to_node(int pxm, int node) 62void __acpi_map_pxm_to_node(int pxm, int node)
62{ 63{
63 pxm_to_node_map[pxm] = node; 64 if (pxm_to_node_map[pxm] == NUMA_NO_NODE || node < pxm_to_node_map[pxm])
64 node_to_pxm_map[node] = pxm; 65 pxm_to_node_map[pxm] = node;
66 if (node_to_pxm_map[node] == PXM_INVAL || pxm < node_to_pxm_map[node])
67 node_to_pxm_map[node] = pxm;
65} 68}
66 69
67int acpi_map_pxm_to_node(int pxm) 70int acpi_map_pxm_to_node(int pxm)
68{ 71{
69 int node = pxm_to_node_map[pxm]; 72 int node = pxm_to_node_map[pxm];
70 73
71 if (node < 0){ 74 if (node < 0) {
72 if (nodes_weight(nodes_found_map) >= MAX_NUMNODES) 75 if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
73 return NID_INVAL; 76 return NUMA_NO_NODE;
74 node = first_unset_node(nodes_found_map); 77 node = first_unset_node(nodes_found_map);
75 __acpi_map_pxm_to_node(pxm, node); 78 __acpi_map_pxm_to_node(pxm, node);
76 node_set(node, nodes_found_map); 79 node_set(node, nodes_found_map);
@@ -79,16 +82,6 @@ int acpi_map_pxm_to_node(int pxm)
79 return node; 82 return node;
80} 83}
81 84
82#if 0
83void __cpuinit acpi_unmap_pxm_to_node(int node)
84{
85 int pxm = node_to_pxm_map[node];
86 pxm_to_node_map[pxm] = NID_INVAL;
87 node_to_pxm_map[node] = PXM_INVAL;
88 node_clear(node, nodes_found_map);
89}
90#endif /* 0 */
91
92static void __init 85static void __init
93acpi_table_print_srat_entry(struct acpi_subtable_header *header) 86acpi_table_print_srat_entry(struct acpi_subtable_header *header)
94{ 87{
@@ -283,22 +276,24 @@ acpi_table_parse_srat(enum acpi_srat_type id,
283 276
284int __init acpi_numa_init(void) 277int __init acpi_numa_init(void)
285{ 278{
279 int ret = 0;
280
286 /* SRAT: Static Resource Affinity Table */ 281 /* SRAT: Static Resource Affinity Table */
287 if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { 282 if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
288 acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY, 283 acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
289 acpi_parse_x2apic_affinity, NR_CPUS); 284 acpi_parse_x2apic_affinity, nr_cpu_ids);
290 acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, 285 acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
291 acpi_parse_processor_affinity, NR_CPUS); 286 acpi_parse_processor_affinity, nr_cpu_ids);
292 acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, 287 ret = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
293 acpi_parse_memory_affinity, 288 acpi_parse_memory_affinity,
294 NR_NODE_MEMBLKS); 289 NR_NODE_MEMBLKS);
295 } 290 }
296 291
297 /* SLIT: System Locality Information Table */ 292 /* SLIT: System Locality Information Table */
298 acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); 293 acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit);
299 294
300 acpi_numa_arch_fixup(); 295 acpi_numa_arch_fixup();
301 return 0; 296 return ret;
302} 297}
303 298
304int acpi_get_pxm(acpi_handle h) 299int acpi_get_pxm(acpi_handle h)