Skip to contentSkip to conversation

x86: Use local variable to cache smp_processor_id() in setup_local_APIC()

PATCH Cyrill Gorcunov 1 participant 1 message Nov 30, 2010

lore
Share & tools
lore

Cyrill Gorcunov

author Acked-by
#0 lore raw
Quoted 7 lines · Tejun Heo

Subject: x86: Use local variable to cache smp_processor_id() in setup_local_APIC()

This is a trivial clean up.

* Move initialization of @cpu inside preemption disabled region as suggested by Cyrill Gorcunov.

Quoted 8 lines
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

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