diff options
author | Ravikiran G Thirumalai <kiran@scalex86.org> | 2005-07-29 00:15:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-29 00:46:02 -0400 |
commit | 8c56ac3f3b12936b03d2626c7572fed5977af515 (patch) | |
tree | 4cb1fa7e6e0a2830d99520f42c6624697d0194c7 /arch | |
parent | 5a7b90137d9f05390cf953d756e1edda2ca88053 (diff) |
[PATCH] x86_64: fix cpu_to_node setup for sparse apic_ids
While booting with SMT disabled in bios, when using acpi srat to setup
cpu_to_node[], sparse apic_ids create problems.
Without this patch, intel x86_64 boxes with hyperthreading disabled in the
bios (and which rely on srat for numa setup) endup having incorrect values in
cpu_to_node[] arrays, causing sched domains to be built incorrectly etc.
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86_64/mm/srat.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c index ec1c4aca451..8e3d097a9dd 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86_64/mm/srat.c | |||
@@ -20,6 +20,9 @@ | |||
20 | 20 | ||
21 | static struct acpi_table_slit *acpi_slit; | 21 | static struct acpi_table_slit *acpi_slit; |
22 | 22 | ||
23 | /* Internal processor count */ | ||
24 | static unsigned int __initdata num_processors = 0; | ||
25 | |||
23 | static nodemask_t nodes_parsed __initdata; | 26 | static nodemask_t nodes_parsed __initdata; |
24 | static nodemask_t nodes_found __initdata; | 27 | static nodemask_t nodes_found __initdata; |
25 | static struct node nodes[MAX_NUMNODES] __initdata; | 28 | static struct node nodes[MAX_NUMNODES] __initdata; |
@@ -101,16 +104,18 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) | |||
101 | bad_srat(); | 104 | bad_srat(); |
102 | return; | 105 | return; |
103 | } | 106 | } |
104 | if (pa->apic_id >= NR_CPUS) { | 107 | if (num_processors >= NR_CPUS) { |
105 | printk(KERN_ERR "SRAT: lapic %u too large.\n", | 108 | printk(KERN_ERR "SRAT: Processor #%d (lapic %u) INVALID. (Max ID: %d).\n", |
106 | pa->apic_id); | 109 | num_processors, pa->apic_id, NR_CPUS); |
107 | bad_srat(); | 110 | bad_srat(); |
108 | return; | 111 | return; |
109 | } | 112 | } |
110 | cpu_to_node[pa->apic_id] = node; | 113 | cpu_to_node[num_processors] = node; |
111 | acpi_numa = 1; | 114 | acpi_numa = 1; |
112 | printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", | 115 | printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> CPU %u -> Node %u\n", |
113 | pxm, pa->apic_id, node); | 116 | pxm, pa->apic_id, num_processors, node); |
117 | |||
118 | num_processors++; | ||
114 | } | 119 | } |
115 | 120 | ||
116 | /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ | 121 | /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ |