aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/smp.c')
-rw-r--r--arch/x86/xen/smp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 6c058585459c..c1b131bcdcbe 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -371,7 +371,8 @@ int xen_smp_call_function_mask(cpumask_t mask, void (*func)(void *),
371 void *info, int wait) 371 void *info, int wait)
372{ 372{
373 struct call_data_struct data; 373 struct call_data_struct data;
374 int cpus; 374 int cpus, cpu;
375 bool yield;
375 376
376 /* Holding any lock stops cpus from going down. */ 377 /* Holding any lock stops cpus from going down. */
377 spin_lock(&call_lock); 378 spin_lock(&call_lock);
@@ -400,9 +401,14 @@ int xen_smp_call_function_mask(cpumask_t mask, void (*func)(void *),
400 /* Send a message to other CPUs and wait for them to respond */ 401 /* Send a message to other CPUs and wait for them to respond */
401 xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR); 402 xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR);
402 403
403 /* Make sure other vcpus get a chance to run. 404 /* Make sure other vcpus get a chance to run if they need to. */
404 XXX too severe? Maybe we should check the other CPU's states? */ 405 yield = false;
405 HYPERVISOR_sched_op(SCHEDOP_yield, 0); 406 for_each_cpu_mask(cpu, mask)
407 if (xen_vcpu_stolen(cpu))
408 yield = true;
409
410 if (yield)
411 HYPERVISOR_sched_op(SCHEDOP_yield, 0);
406 412
407 /* Wait for response */ 413 /* Wait for response */
408 while (atomic_read(&data.started) != cpus || 414 while (atomic_read(&data.started) != cpus ||