[lkml]   [2010]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 04/16] x86: Use local variable to cache smp_processor_id() in setup_local_APIC()
On Sat, Nov 27, 2010 at 04:21:53PM +0100, Tejun Heo wrote:
> This is a trivial clean up.
> Signed-off-by: Tejun Heo <>
> Cc: Yinghai Lu <>
> ---
> arch/x86/kernel/apic/apic.c | 13 ++++++-------
> 1 files changed, 6 insertions(+), 7 deletions(-)

Hi Tejun, I belive we should put in change log that it's
not a trivial change. The cpu gets cached before preemption
disabled and used after preemption enabled, which is not
1:1 like it was before.

Though at moment all setup_local_APIC callers have preemption
disabled this might be changed in future and heck knows what side
effect we would have :)

Perhaps the easiest would be to make cpu = smp_processor_id()
after preempt_disable() call and leave the last snippet in this

/* Recheck CMCI information after local APIC is up on CPU #0 */
if (smp_processor_id() == 0)


On the other hands I might be too paranoid ;)


 \ /
  Last update: 2010-11-27 22:35    [W:0.199 / U:1.348 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site