aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mach-voyager
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2007-10-19 14:35:04 -0400
committerThomas Gleixner <tglx@linutronix.de>2007-10-19 14:35:04 -0400
commit92cb7612aee39642d109b8d935ad265e602c0563 (patch)
tree307f4183226f52418bd6842b5d970f03524ad1c1 /arch/x86/mach-voyager
parentf1df280f53d7c3ce8613a3b25d1efe009b9860dd (diff)
x86: convert cpuinfo_x86 array to a per_cpu array
cpu_data is currently an array defined using NR_CPUS. This means that we overallocate since we will rarely really use maximum configured cpus. When NR_CPU count is raised to 4096 the size of cpu_data becomes 3,145,728 bytes. These changes were adopted from the sparc64 (and ia64) code. An additional field was added to cpuinfo_x86 to be a non-ambiguous cpu index. This corresponds to the index into a cpumask_t as well as the per_cpu index. It's used in various places like show_cpuinfo(). cpu_data is defined to be the boot_cpu_data structure for the NON-SMP case. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Christoph Lameter <clameter@sgi.com> Cc: Andi Kleen <ak@suse.de> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mach-voyager')
-rw-r--r--arch/x86/mach-voyager/voyager_smp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
index e4928aa6bdfb..f93a730b44d0 100644
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
@@ -36,8 +36,8 @@ static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR
36 36
37/* per CPU data structure (for /proc/cpuinfo et al), visible externally 37/* per CPU data structure (for /proc/cpuinfo et al), visible externally
38 * indexed physically */ 38 * indexed physically */
39struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; 39DEFINE_PER_CPU(cpuinfo_x86, cpu_info) __cacheline_aligned;
40EXPORT_SYMBOL(cpu_data); 40EXPORT_PER_CPU_SYMBOL(cpu_info);
41 41
42/* physical ID of the CPU used to boot the system */ 42/* physical ID of the CPU used to boot the system */
43unsigned char boot_cpu_id; 43unsigned char boot_cpu_id;
@@ -430,7 +430,7 @@ find_smp_config(void)
430void __init 430void __init
431smp_store_cpu_info(int id) 431smp_store_cpu_info(int id)
432{ 432{
433 struct cpuinfo_x86 *c=&cpu_data[id]; 433 struct cpuinfo_x86 *c = &cpu_data(id);
434 434
435 *c = boot_cpu_data; 435 *c = boot_cpu_data;
436 436
@@ -634,7 +634,7 @@ do_boot_cpu(__u8 cpu)
634 cpu, smp_processor_id())); 634 cpu, smp_processor_id()));
635 635
636 printk("CPU%d: ", cpu); 636 printk("CPU%d: ", cpu);
637 print_cpu_info(&cpu_data[cpu]); 637 print_cpu_info(&cpu_data(cpu));
638 wmb(); 638 wmb();
639 cpu_set(cpu, cpu_callout_map); 639 cpu_set(cpu, cpu_callout_map);
640 cpu_set(cpu, cpu_present_map); 640 cpu_set(cpu, cpu_present_map);
@@ -683,7 +683,7 @@ smp_boot_cpus(void)
683 */ 683 */
684 smp_store_cpu_info(boot_cpu_id); 684 smp_store_cpu_info(boot_cpu_id);
685 printk("CPU%d: ", boot_cpu_id); 685 printk("CPU%d: ", boot_cpu_id);
686 print_cpu_info(&cpu_data[boot_cpu_id]); 686 print_cpu_info(&cpu_data(boot_cpu_id));
687 687
688 if(is_cpu_quad()) { 688 if(is_cpu_quad()) {
689 /* booting on a Quad CPU */ 689 /* booting on a Quad CPU */
@@ -714,7 +714,7 @@ smp_boot_cpus(void)
714 unsigned long bogosum = 0; 714 unsigned long bogosum = 0;
715 for (i = 0; i < NR_CPUS; i++) 715 for (i = 0; i < NR_CPUS; i++)
716 if (cpu_isset(i, cpu_online_map)) 716 if (cpu_isset(i, cpu_online_map))
717 bogosum += cpu_data[i].loops_per_jiffy; 717 bogosum += cpu_data(i).loops_per_jiffy;
718 printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", 718 printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
719 cpucount+1, 719 cpucount+1,
720 bogosum/(500000/HZ), 720 bogosum/(500000/HZ),