Commit 693e3c56 authored by Mike Travis's avatar Mike Travis Committed by Ingo Molnar

x86: reduce memory and intra-node effects

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 4dbf7af6
...@@ -1175,14 +1175,15 @@ __cpuinit int apic_is_clustered_box(void) ...@@ -1175,14 +1175,15 @@ __cpuinit int apic_is_clustered_box(void)
{ {
int i, clusters, zeros; int i, clusters, zeros;
unsigned id; unsigned id;
u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS); DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
bitmap_zero(clustermap, NUM_APIC_CLUSTERS); bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
for (i = 0; i < NR_CPUS; i++) { for (i = 0; i < NR_CPUS; i++) {
/* are we being called early in kernel startup? */ /* are we being called early in kernel startup? */
if (x86_bios_cpu_apicid_early_ptr) { if (bios_cpu_apicid) {
id = ((u16 *)x86_bios_cpu_apicid_early_ptr)[i]; id = bios_cpu_apicid[i];
} }
else if (i < nr_cpu_ids) { else if (i < nr_cpu_ids) {
if (cpu_present(i)) if (cpu_present(i))
......
...@@ -130,8 +130,8 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m) ...@@ -130,8 +130,8 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
} }
/* are we being called early in kernel startup? */ /* are we being called early in kernel startup? */
if (x86_cpu_to_apicid_early_ptr) { if (x86_cpu_to_apicid_early_ptr) {
u16 *cpu_to_apicid = (u16 *)x86_cpu_to_apicid_early_ptr; u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
u16 *bios_cpu_apicid = (u16 *)x86_bios_cpu_apicid_early_ptr; u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
cpu_to_apicid[cpu] = m->mpc_apicid; cpu_to_apicid[cpu] = m->mpc_apicid;
bios_cpu_apicid[cpu] = m->mpc_apicid; bios_cpu_apicid[cpu] = m->mpc_apicid;
......
...@@ -562,7 +562,7 @@ __cpuinit void numa_add_cpu(int cpu) ...@@ -562,7 +562,7 @@ __cpuinit void numa_add_cpu(int cpu)
void __cpuinit numa_set_node(int cpu, int node) void __cpuinit numa_set_node(int cpu, int node)
{ {
u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr; u16 *cpu_to_node_map = x86_cpu_to_node_map_early_ptr;
cpu_pda(cpu)->nodenumber = node; cpu_pda(cpu)->nodenumber = node;
......
...@@ -346,8 +346,12 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) ...@@ -346,8 +346,12 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
/* First clean up the node list */ /* First clean up the node list */
for (i = 0; i < MAX_NUMNODES; i++) { for (i = 0; i < MAX_NUMNODES; i++) {
cutoff_node(i, start, end); cutoff_node(i, start, end);
/* ZZZ why was this needed. At least add a comment */ /*
if (nodes[i].end && (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) { * don't confuse VM with a node that doesn't have the
* minimum memory.
*/
if (nodes[i].end &&
(nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
unparse_node(i); unparse_node(i);
node_set_offline(i); node_set_offline(i);
} }
......
...@@ -40,7 +40,7 @@ extern cpumask_t node_to_cpumask_map[]; ...@@ -40,7 +40,7 @@ extern cpumask_t node_to_cpumask_map[];
/* Returns the number of the node containing CPU 'cpu' */ /* Returns the number of the node containing CPU 'cpu' */
static inline int cpu_to_node(int cpu) static inline int cpu_to_node(int cpu)
{ {
u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr; u16 *cpu_to_node_map = x86_cpu_to_node_map_early_ptr;
if (cpu_to_node_map) if (cpu_to_node_map)
return cpu_to_node_map[cpu]; return cpu_to_node_map[cpu];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment