Skip to content

Commit

Permalink
x86-smp-remove-call-to-ipi_call_lock-ipi_call_unlock
Browse files Browse the repository at this point in the history
ipi_call_lock/unlock() lock resp. unlock call_function.lock. This lock
protects only the call_function data structure itself, but it's
completely unrelated to cpu_online_mask. The mask to which the IPIs
are sent is calculated before call_function.lock is taken in
smp_call_function_many(), so the locking around set_cpu_online() is
pointless and can be removed.

[ tglx: Massaged changelog ]

Signed-off-by: Yong Zhang <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Jeremy Fitzhardinge <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Acked-by: Srivatsa S. Bhat <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
yongzhang0 authored and KAGA-KOKO committed Jun 5, 2012
1 parent 8efdfc3 commit 3b6f70f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
9 changes: 0 additions & 9 deletions arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,13 @@ notrace static void __cpuinit start_secondary(void *unused)
check_tsc_sync_target();

/*
* We need to hold call_lock, so there is no inconsistency
* between the time smp_call_function() determines number of
* IPI recipients, and the time when the determination is made
* for which cpus receive the IPI. Holding this
* lock helps us to not include this cpu in a currently in progress
* smp_call_function().
*
* We need to hold vector_lock so there the set of online cpus
* does not change while we are assigning vectors to cpus. Holding
* this lock ensures we don't half assign or remove an irq from a cpu.
*/
ipi_call_lock();
lock_vector_lock();
set_cpu_online(smp_processor_id(), true);
unlock_vector_lock();
ipi_call_unlock();
per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
x86_platform.nmi_init();

Expand Down
2 changes: 0 additions & 2 deletions arch/x86/xen/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ static void __cpuinit cpu_bringup(void)

notify_cpu_starting(cpu);

ipi_call_lock();
set_cpu_online(cpu, true);
ipi_call_unlock();

this_cpu_write(cpu_state, CPU_ONLINE);

Expand Down

0 comments on commit 3b6f70f

Please sign in to comment.