Commit 82a22528 authored by Robert Richter's avatar Robert Richter

x86/oprofile: Use per_cpu() instead of __get_cpu_var()

__get_cpu_var() calls smp_processor_id(). When the cpu id is already
known, instead use per_cpu() to avoid generating the id again.
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent 5e766e3e
...@@ -294,7 +294,7 @@ static void nmi_cpu_shutdown(void *dummy) ...@@ -294,7 +294,7 @@ static void nmi_cpu_shutdown(void *dummy)
{ {
unsigned int v; unsigned int v;
int cpu = smp_processor_id(); int cpu = smp_processor_id();
struct op_msrs *msrs = &__get_cpu_var(cpu_msrs); struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu);
/* restoring APIC_LVTPC can trigger an apic error because the delivery /* restoring APIC_LVTPC can trigger an apic error because the delivery
* mode and vector nr combination can be illegal. That's by design: on * mode and vector nr combination can be illegal. That's by design: on
...@@ -307,7 +307,7 @@ static void nmi_cpu_shutdown(void *dummy) ...@@ -307,7 +307,7 @@ static void nmi_cpu_shutdown(void *dummy)
apic_write(APIC_LVTERR, v); apic_write(APIC_LVTERR, v);
nmi_cpu_restore_registers(msrs); nmi_cpu_restore_registers(msrs);
#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
__get_cpu_var(switch_index) = 0; per_cpu(switch_index, cpu) = 0;
#endif #endif
} }
......
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