x86: Use local variable to cache smp_processor_id() in setup_local_APIC()
Cyrill Gorcunov
Acked-byQuoted 7 lines · Tejun Heo
Subject: x86: Use local variable to cache
smp_processor_id()insetup_local_APIC()This is a trivial clean up.
* Move initialization of @cpu inside preemption disabled region as suggested by Cyrill Gorcunov.
Quoted 8 lines
Signed-off-by Tejun Heo <[email protected]>Cc Yinghai Lu <[email protected]>Cc Cyrill Gorcunov <[email protected]>---
Updated as suggested. Git tree updated too.Thanks.
Thanks Tejun, but please don't modify the snippet below (ie leave it with smp_processor_id). It happens when preempt gets enabled again but cpu cached with preempt disabled. So we should not mess this I believe. ok?
Other than that
Acked-by Cyrill Gorcunov <[email protected]>
Thanks!
Review void __cpuinit setup_local_APIC(void) · line 1373
Quoted 10 lines
(quoted diff) +1
-1@@ -1368,7 +1367,7 @@ void __cpuinit setup_local_APIC(void) #ifdef CONFIG_X86_MCE_INTEL /* Recheck CMCI information after local APIC is up on CPU #0 */ - if (smp_processor_id() == 0) + if (cpu == 0) cmci_recheck(); #endif }
Cyrill