diff options
author | Keir Fraser <keir@xen.org> | 2011-05-09 12:16:34 +0100 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-05-09 12:16:34 +0100 |
commit | 5f91f34bd017375330b2997b3754edb5d4eb1f6d (patch) | |
tree | 5d801e98f6970541af377a68b22935d1bdad1684 | |
parent | 781b1e5b94446177c921e9ccdbb3b40b6653a3be (diff) | |
download | xen-5f91f34bd017375330b2997b3754edb5d4eb1f6d.tar.gz xen-5f91f34bd017375330b2997b3754edb5d4eb1f6d.tar.bz2 xen-5f91f34bd017375330b2997b3754edb5d4eb1f6d.zip |
x86: Clean up smp_call_function handling.
We don't need so many communication fields between caller and
handler.
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 23285:a7ac0a0170b0
xen-unstable date: Sun May 01 09:32:48 2011 +0100
-rw-r--r-- | xen/arch/x86/smp.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c index f97a9e491d..2f527079cd 100644 --- a/xen/arch/x86/smp.c +++ b/xen/arch/x86/smp.c @@ -280,8 +280,6 @@ static struct call_data_struct { void (*func) (void *info); void *info; int wait; - atomic_t started; - atomic_t finished; cpumask_t selected; } call_data; @@ -316,8 +314,6 @@ void on_selected_cpus( call_data.func = func; call_data.info = info; call_data.wait = wait; - atomic_set(&call_data.started, 0); - atomic_set(&call_data.finished, 0); send_IPI_mask(&call_data.selected, CALL_FUNCTION_VECTOR); @@ -328,8 +324,7 @@ void on_selected_cpus( local_irq_enable(); } - while ( atomic_read(wait ? &call_data.finished : &call_data.started) - != nr_cpus ) + while ( !cpus_empty(call_data.selected) ) cpu_relax(); out: @@ -397,8 +392,9 @@ static void __smp_call_function_interrupt(void) { void (*func)(void *info) = call_data.func; void *info = call_data.info; + unsigned int cpu = smp_processor_id(); - if ( !cpu_isset(smp_processor_id(), call_data.selected) ) + if ( !cpu_isset(cpu, call_data.selected) ) return; irq_enter(); @@ -407,12 +403,12 @@ static void __smp_call_function_interrupt(void) { (*func)(info); mb(); - atomic_inc(&call_data.finished); + cpu_clear(cpu, call_data.selected); } else { mb(); - atomic_inc(&call_data.started); + cpu_clear(cpu, call_data.selected); (*func)(info); } |