lkml.org 
[lkml]   [2010]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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 <tj@kernel.org>
> Cc: Yinghai Lu <yinghai@kernel.org>
> ---
> 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
function

#ifdef CONFIG_X86_MCE_INTEL
/* Recheck CMCI information after local APIC is up on CPU #0 */
if (smp_processor_id() == 0)
cmci_recheck();
#endif
untouched.

On the other hands I might be too paranoid ;)

Cyrill


\
 
 \ /
  Last update: 2010-11-27 22:35    [from the cache]
©2003-2011 Jasper Spaans