Re: [PATCH 04/16] x86: Use local variable to cachesmp_processor_id() in setup_local_APIC()

From: Cyrill Gorcunov
Date: Sat Nov 27 2010 - 16:37:34 EST


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@xxxxxxxxxx>
> Cc: Yinghai Lu <yinghai@xxxxxxxxxx>
> ---
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/