aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-01-30 07:33:14 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:14 -0500
commit693e3c560317577a29c625d89f6745d5c7cfd918 (patch)
tree2f8420f929e8cdb8167a57104b7938658cdd3a8f
parent4dbf7af6442a9a882855bed0d999659ac413e3ac (diff)
x86: reduce memory and intra-node effects
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/kernel/apic_64.c5
-rw-r--r--arch/x86/kernel/mpparse_64.c6
-rw-r--r--arch/x86/mm/numa_64.c2
-rw-r--r--arch/x86/mm/srat_64.c8
-rw-r--r--include/asm-x86/topology.h2
5 files changed, 14 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index f9919c492699..85bd3d463cdf 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -1175,14 +1175,15 @@ __cpuinit int apic_is_clustered_box(void)
1175{ 1175{
1176 int i, clusters, zeros; 1176 int i, clusters, zeros;
1177 unsigned id; 1177 unsigned id;
1178 u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
1178 DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS); 1179 DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
1179 1180
1180 bitmap_zero(clustermap, NUM_APIC_CLUSTERS); 1181 bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
1181 1182
1182 for (i = 0; i < NR_CPUS; i++) { 1183 for (i = 0; i < NR_CPUS; i++) {
1183 /* are we being called early in kernel startup? */ 1184 /* are we being called early in kernel startup? */
1184 if (x86_bios_cpu_apicid_early_ptr) { 1185 if (bios_cpu_apicid) {
1185 id = ((u16 *)x86_bios_cpu_apicid_early_ptr)[i]; 1186 id = bios_cpu_apicid[i];
1186 } 1187 }
1187 else if (i < nr_cpu_ids) { 1188 else if (i < nr_cpu_ids) {
1188 if (cpu_present(i)) 1189 if (cpu_present(i))
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c
index fd671754dcb5..d3260f8f17dc 100644
--- a/arch/x86/kernel/mpparse_64.c
+++ b/arch/x86/kernel/mpparse_64.c
@@ -122,7 +122,7 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
122 physid_set(m->mpc_apicid, phys_cpu_present_map); 122 physid_set(m->mpc_apicid, phys_cpu_present_map);
123 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { 123 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
124 /* 124 /*
125 * x86_bios_cpu_apicid is required to have processors listed 125 * x86_bios_cpu_apicid is required to have processors listed
126 * in same order as logical cpu numbers. Hence the first 126 * in same order as logical cpu numbers. Hence the first
127 * entry is BSP, and so on. 127 * entry is BSP, and so on.
128 */ 128 */
@@ -130,8 +130,8 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
130 } 130 }
131 /* are we being called early in kernel startup? */ 131 /* are we being called early in kernel startup? */
132 if (x86_cpu_to_apicid_early_ptr) { 132 if (x86_cpu_to_apicid_early_ptr) {
133 u16 *cpu_to_apicid = (u16 *)x86_cpu_to_apicid_early_ptr; 133 u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
134 u16 *bios_cpu_apicid = (u16 *)x86_bios_cpu_apicid_early_ptr; 134 u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
135 135
136 cpu_to_apicid[cpu] = m->mpc_apicid; 136 cpu_to_apicid[cpu] = m->mpc_apicid;
137 bios_cpu_apicid[cpu] = m->mpc_apicid; 137 bios_cpu_apicid[cpu] = m->mpc_apicid;
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 382377d6421d..dca58fb39b08 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -562,7 +562,7 @@ __cpuinit void numa_add_cpu(int cpu)
562 562
563void __cpuinit numa_set_node(int cpu, int node) 563void __cpuinit numa_set_node(int cpu, int node)
564{ 564{
565 u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr; 565 u16 *cpu_to_node_map = x86_cpu_to_node_map_early_ptr;
566 566
567 cpu_pda(cpu)->nodenumber = node; 567 cpu_pda(cpu)->nodenumber = node;
568 568
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index bccbdc7be434..e5a1ec8342dc 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -346,8 +346,12 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
346 /* First clean up the node list */ 346 /* First clean up the node list */
347 for (i = 0; i < MAX_NUMNODES; i++) { 347 for (i = 0; i < MAX_NUMNODES; i++) {
348 cutoff_node(i, start, end); 348 cutoff_node(i, start, end);
349 /* ZZZ why was this needed. At least add a comment */ 349 /*
350 if (nodes[i].end && (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) { 350 * don't confuse VM with a node that doesn't have the
351 * minimum memory.
352 */
353 if (nodes[i].end &&
354 (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
351 unparse_node(i); 355 unparse_node(i);
352 node_set_offline(i); 356 node_set_offline(i);
353 } 357 }
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index e612ed8d2bc7..a89b46eb2526 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -40,7 +40,7 @@ extern cpumask_t node_to_cpumask_map[];
40/* Returns the number of the node containing CPU 'cpu' */ 40/* Returns the number of the node containing CPU 'cpu' */
41static inline int cpu_to_node(int cpu) 41static inline int cpu_to_node(int cpu)
42{ 42{
43 u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr; 43 u16 *cpu_to_node_map = x86_cpu_to_node_map_early_ptr;
44 44
45 if (cpu_to_node_map) 45 if (cpu_to_node_map)
46 return cpu_to_node_map[cpu]; 46 return cpu_to_node_map[cpu];