diff options
author | Christoph Lameter <cl@linux.com> | 2011-03-12 06:50:46 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-03-29 04:18:30 -0400 |
commit | fe5042138b6fc60edde3b60025078884c2eb71ac (patch) | |
tree | 72f4489eda86a58d81030c6c69678e27ec5bd919 | |
parent | 349c004e3d31fda23ad225b61861be38047fff16 (diff) |
x86: Use this_cpu_has for thermal_interrupt current cpu
It is more effective to use a segment prefix instead of calculating the
address of the current cpu area amd then testing flags.
Signed-off-by: Christoph Lameter <cl@linux.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/therm_throt.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 6f8c5e9da97f..6b0f4cde7a22 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
@@ -355,7 +355,6 @@ static void notify_thresholds(__u64 msr_val) | |||
355 | static void intel_thermal_interrupt(void) | 355 | static void intel_thermal_interrupt(void) |
356 | { | 356 | { |
357 | __u64 msr_val; | 357 | __u64 msr_val; |
358 | struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); | ||
359 | 358 | ||
360 | rdmsrl(MSR_IA32_THERM_STATUS, msr_val); | 359 | rdmsrl(MSR_IA32_THERM_STATUS, msr_val); |
361 | 360 | ||
@@ -367,19 +366,19 @@ static void intel_thermal_interrupt(void) | |||
367 | CORE_LEVEL) != 0) | 366 | CORE_LEVEL) != 0) |
368 | mce_log_therm_throt_event(CORE_THROTTLED | msr_val); | 367 | mce_log_therm_throt_event(CORE_THROTTLED | msr_val); |
369 | 368 | ||
370 | if (cpu_has(c, X86_FEATURE_PLN)) | 369 | if (this_cpu_has(X86_FEATURE_PLN)) |
371 | if (therm_throt_process(msr_val & THERM_STATUS_POWER_LIMIT, | 370 | if (therm_throt_process(msr_val & THERM_STATUS_POWER_LIMIT, |
372 | POWER_LIMIT_EVENT, | 371 | POWER_LIMIT_EVENT, |
373 | CORE_LEVEL) != 0) | 372 | CORE_LEVEL) != 0) |
374 | mce_log_therm_throt_event(CORE_POWER_LIMIT | msr_val); | 373 | mce_log_therm_throt_event(CORE_POWER_LIMIT | msr_val); |
375 | 374 | ||
376 | if (cpu_has(c, X86_FEATURE_PTS)) { | 375 | if (this_cpu_has(X86_FEATURE_PTS)) { |
377 | rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val); | 376 | rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val); |
378 | if (therm_throt_process(msr_val & PACKAGE_THERM_STATUS_PROCHOT, | 377 | if (therm_throt_process(msr_val & PACKAGE_THERM_STATUS_PROCHOT, |
379 | THERMAL_THROTTLING_EVENT, | 378 | THERMAL_THROTTLING_EVENT, |
380 | PACKAGE_LEVEL) != 0) | 379 | PACKAGE_LEVEL) != 0) |
381 | mce_log_therm_throt_event(PACKAGE_THROTTLED | msr_val); | 380 | mce_log_therm_throt_event(PACKAGE_THROTTLED | msr_val); |
382 | if (cpu_has(c, X86_FEATURE_PLN)) | 381 | if (this_cpu_has(X86_FEATURE_PLN)) |
383 | if (therm_throt_process(msr_val & | 382 | if (therm_throt_process(msr_val & |
384 | PACKAGE_THERM_STATUS_POWER_LIMIT, | 383 | PACKAGE_THERM_STATUS_POWER_LIMIT, |
385 | POWER_LIMIT_EVENT, | 384 | POWER_LIMIT_EVENT, |