Re: [PATCH UPDATED#3 04/16] x86: setup_local_APIC() must always becalled with preemption disabled

From: Cyrill Gorcunov
Date: Thu Dec 09 2010 - 11:17:17 EST


On Thu, Dec 09, 2010 at 11:47:21AM +0100, Tejun Heo wrote:
> setup_local_APIC() is used to setup local APIC early during CPU
> initialization and already assumes that preemption is disabled on
> entry. However, The function unnecessarily disables and enables
> preemption and uses smp_processor_id() multiple times in and out of
> the nested preemption disabled section. This gives the wrong
> impression that the function might be able to handle being called with
> preemption enabled and/or migrated to another processor in the middle.
>
> Make it clear that the function is always called with preemption
> disabled, drop the confusing preemption disable block and call
> smp_processor_id() once at the beginning of the function.
>
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> Cc: Yinghai Lu <yinghai@xxxxxxxxxx>
> Cc: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
> Cc: Pekka Enberg <penberg@xxxxxxxxxx>
> ---

Thanks a lot, Tejun!
FWIW
Acked-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
--
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/