aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/cpufreq
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/kernel/cpu/cpufreq
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/kernel/cpu/cpufreq')
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/e_powersaver.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/elanfreq.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longhaul.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longrun.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/p4-clockmod.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k6.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k7.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/sc520_freq.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c6
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-lib.c2
11 files changed, 19 insertions, 19 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index 2ca43ba32bc0..fea0af0476b9 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -77,7 +77,7 @@ static unsigned int acpi_pstate_strict;
77 77
78static int check_est_cpu(unsigned int cpuid) 78static int check_est_cpu(unsigned int cpuid)
79{ 79{
80 struct cpuinfo_x86 *cpu = &cpu_data[cpuid]; 80 struct cpuinfo_x86 *cpu = &cpu_data(cpuid);
81 81
82 if (cpu->x86_vendor != X86_VENDOR_INTEL || 82 if (cpu->x86_vendor != X86_VENDOR_INTEL ||
83 !cpu_has(cpu, X86_FEATURE_EST)) 83 !cpu_has(cpu, X86_FEATURE_EST))
@@ -560,7 +560,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
560 unsigned int cpu = policy->cpu; 560 unsigned int cpu = policy->cpu;
561 struct acpi_cpufreq_data *data; 561 struct acpi_cpufreq_data *data;
562 unsigned int result = 0; 562 unsigned int result = 0;
563 struct cpuinfo_x86 *c = &cpu_data[policy->cpu]; 563 struct cpuinfo_x86 *c = &cpu_data(policy->cpu);
564 struct acpi_processor_performance *perf; 564 struct acpi_processor_performance *perf;
565 565
566 dprintk("acpi_cpufreq_cpu_init\n"); 566 dprintk("acpi_cpufreq_cpu_init\n");
diff --git a/arch/x86/kernel/cpu/cpufreq/e_powersaver.c b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c
index c11baaf9f2b4..326a4c81f684 100644
--- a/arch/x86/kernel/cpu/cpufreq/e_powersaver.c
+++ b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c
@@ -305,7 +305,7 @@ static struct cpufreq_driver eps_driver = {
305 305
306static int __init eps_init(void) 306static int __init eps_init(void)
307{ 307{
308 struct cpuinfo_x86 *c = cpu_data; 308 struct cpuinfo_x86 *c = &cpu_data(0);
309 309
310 /* This driver will work only on Centaur C7 processors with 310 /* This driver will work only on Centaur C7 processors with
311 * Enhanced SpeedStep/PowerSaver registers */ 311 * Enhanced SpeedStep/PowerSaver registers */
diff --git a/arch/x86/kernel/cpu/cpufreq/elanfreq.c b/arch/x86/kernel/cpu/cpufreq/elanfreq.c
index 1e7ae7dafcf6..94619c22f563 100644
--- a/arch/x86/kernel/cpu/cpufreq/elanfreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/elanfreq.c
@@ -199,7 +199,7 @@ static int elanfreq_target (struct cpufreq_policy *policy,
199 199
200static int elanfreq_cpu_init(struct cpufreq_policy *policy) 200static int elanfreq_cpu_init(struct cpufreq_policy *policy)
201{ 201{
202 struct cpuinfo_x86 *c = cpu_data; 202 struct cpuinfo_x86 *c = &cpu_data(0);
203 unsigned int i; 203 unsigned int i;
204 int result; 204 int result;
205 205
@@ -280,7 +280,7 @@ static struct cpufreq_driver elanfreq_driver = {
280 280
281static int __init elanfreq_init(void) 281static int __init elanfreq_init(void)
282{ 282{
283 struct cpuinfo_x86 *c = cpu_data; 283 struct cpuinfo_x86 *c = &cpu_data(0);
284 284
285 /* Test if we have the right hardware */ 285 /* Test if we have the right hardware */
286 if ((c->x86_vendor != X86_VENDOR_AMD) || 286 if ((c->x86_vendor != X86_VENDOR_AMD) ||
diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c
index 5045f5d583c8..749d00cb2ebd 100644
--- a/arch/x86/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c
@@ -780,7 +780,7 @@ static int longhaul_setup_southbridge(void)
780 780
781static int __init longhaul_cpu_init(struct cpufreq_policy *policy) 781static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
782{ 782{
783 struct cpuinfo_x86 *c = cpu_data; 783 struct cpuinfo_x86 *c = &cpu_data(0);
784 char *cpuname=NULL; 784 char *cpuname=NULL;
785 int ret; 785 int ret;
786 u32 lo, hi; 786 u32 lo, hi;
@@ -959,7 +959,7 @@ static struct cpufreq_driver longhaul_driver = {
959 959
960static int __init longhaul_init(void) 960static int __init longhaul_init(void)
961{ 961{
962 struct cpuinfo_x86 *c = cpu_data; 962 struct cpuinfo_x86 *c = &cpu_data(0);
963 963
964 if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6) 964 if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6)
965 return -ENODEV; 965 return -ENODEV;
diff --git a/arch/x86/kernel/cpu/cpufreq/longrun.c b/arch/x86/kernel/cpu/cpufreq/longrun.c
index b2689514295a..af4a867a097c 100644
--- a/arch/x86/kernel/cpu/cpufreq/longrun.c
+++ b/arch/x86/kernel/cpu/cpufreq/longrun.c
@@ -172,7 +172,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq,
172 u32 save_lo, save_hi; 172 u32 save_lo, save_hi;
173 u32 eax, ebx, ecx, edx; 173 u32 eax, ebx, ecx, edx;
174 u32 try_hi; 174 u32 try_hi;
175 struct cpuinfo_x86 *c = cpu_data; 175 struct cpuinfo_x86 *c = &cpu_data(0);
176 176
177 if (!low_freq || !high_freq) 177 if (!low_freq || !high_freq)
178 return -EINVAL; 178 return -EINVAL;
@@ -298,7 +298,7 @@ static struct cpufreq_driver longrun_driver = {
298 */ 298 */
299static int __init longrun_init(void) 299static int __init longrun_init(void)
300{ 300{
301 struct cpuinfo_x86 *c = cpu_data; 301 struct cpuinfo_x86 *c = &cpu_data(0);
302 302
303 if (c->x86_vendor != X86_VENDOR_TRANSMETA || 303 if (c->x86_vendor != X86_VENDOR_TRANSMETA ||
304 !cpu_has(c, X86_FEATURE_LONGRUN)) 304 !cpu_has(c, X86_FEATURE_LONGRUN))
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index 793eae854f4f..14791ec55cfd 100644
--- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
@@ -195,7 +195,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
195 195
196static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) 196static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
197{ 197{
198 struct cpuinfo_x86 *c = &cpu_data[policy->cpu]; 198 struct cpuinfo_x86 *c = &cpu_data(policy->cpu);
199 int cpuid = 0; 199 int cpuid = 0;
200 unsigned int i; 200 unsigned int i;
201 201
@@ -279,7 +279,7 @@ static struct cpufreq_driver p4clockmod_driver = {
279 279
280static int __init cpufreq_p4_init(void) 280static int __init cpufreq_p4_init(void)
281{ 281{
282 struct cpuinfo_x86 *c = cpu_data; 282 struct cpuinfo_x86 *c = &cpu_data(0);
283 int ret; 283 int ret;
284 284
285 /* 285 /*
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k6.c b/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
index 6d0285339317..42405b4e34ed 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
@@ -215,7 +215,7 @@ static struct cpufreq_driver powernow_k6_driver = {
215 */ 215 */
216static int __init powernow_k6_init(void) 216static int __init powernow_k6_init(void)
217{ 217{
218 struct cpuinfo_x86 *c = cpu_data; 218 struct cpuinfo_x86 *c = &cpu_data(0);
219 219
220 if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 != 5) || 220 if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 != 5) ||
221 ((c->x86_model != 12) && (c->x86_model != 13))) 221 ((c->x86_model != 12) && (c->x86_model != 13)))
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
index f3686a5f2308..b5a9863d6cdc 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
@@ -114,7 +114,7 @@ static int check_fsb(unsigned int fsbspeed)
114 114
115static int check_powernow(void) 115static int check_powernow(void)
116{ 116{
117 struct cpuinfo_x86 *c = cpu_data; 117 struct cpuinfo_x86 *c = &cpu_data(0);
118 unsigned int maxei, eax, ebx, ecx, edx; 118 unsigned int maxei, eax, ebx, ecx, edx;
119 119
120 if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 !=6)) { 120 if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 !=6)) {
diff --git a/arch/x86/kernel/cpu/cpufreq/sc520_freq.c b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
index d9f3e90a7ae0..42da9bd677d6 100644
--- a/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
+++ b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
@@ -102,7 +102,7 @@ static int sc520_freq_target (struct cpufreq_policy *policy,
102 102
103static int sc520_freq_cpu_init(struct cpufreq_policy *policy) 103static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
104{ 104{
105 struct cpuinfo_x86 *c = cpu_data; 105 struct cpuinfo_x86 *c = &cpu_data(0);
106 int result; 106 int result;
107 107
108 /* capability check */ 108 /* capability check */
@@ -151,7 +151,7 @@ static struct cpufreq_driver sc520_freq_driver = {
151 151
152static int __init sc520_freq_init(void) 152static int __init sc520_freq_init(void)
153{ 153{
154 struct cpuinfo_x86 *c = cpu_data; 154 struct cpuinfo_x86 *c = &cpu_data(0);
155 int err; 155 int err;
156 156
157 /* Test if we have the right hardware */ 157 /* Test if we have the right hardware */
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
index 811d47438546..3031f1196192 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -230,7 +230,7 @@ static struct cpu_model models[] =
230 230
231static int centrino_cpu_init_table(struct cpufreq_policy *policy) 231static int centrino_cpu_init_table(struct cpufreq_policy *policy)
232{ 232{
233 struct cpuinfo_x86 *cpu = &cpu_data[policy->cpu]; 233 struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu);
234 struct cpu_model *model; 234 struct cpu_model *model;
235 235
236 for(model = models; model->cpu_id != NULL; model++) 236 for(model = models; model->cpu_id != NULL; model++)
@@ -340,7 +340,7 @@ static unsigned int get_cur_freq(unsigned int cpu)
340 340
341static int centrino_cpu_init(struct cpufreq_policy *policy) 341static int centrino_cpu_init(struct cpufreq_policy *policy)
342{ 342{
343 struct cpuinfo_x86 *cpu = &cpu_data[policy->cpu]; 343 struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu);
344 unsigned freq; 344 unsigned freq;
345 unsigned l, h; 345 unsigned l, h;
346 int ret; 346 int ret;
@@ -612,7 +612,7 @@ static struct cpufreq_driver centrino_driver = {
612 */ 612 */
613static int __init centrino_init(void) 613static int __init centrino_init(void)
614{ 614{
615 struct cpuinfo_x86 *cpu = cpu_data; 615 struct cpuinfo_x86 *cpu = &cpu_data(0);
616 616
617 if (!cpu_has(cpu, X86_FEATURE_EST)) 617 if (!cpu_has(cpu, X86_FEATURE_EST))
618 return -ENODEV; 618 return -ENODEV;
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
index b1acc8ce3167..76c3ab0da468 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
@@ -228,7 +228,7 @@ EXPORT_SYMBOL_GPL(speedstep_get_processor_frequency);
228 228
229unsigned int speedstep_detect_processor (void) 229unsigned int speedstep_detect_processor (void)
230{ 230{
231 struct cpuinfo_x86 *c = cpu_data; 231 struct cpuinfo_x86 *c = &cpu_data(0);
232 u32 ebx, msr_lo, msr_hi; 232 u32 ebx, msr_lo, msr_hi;
233 233
234 dprintk("x86: %x, model: %x\n", c->x86, c->x86_model); 234 dprintk("x86: %x, model: %x\n", c->x86, c->x86_model);