diff -r 062311a1fd19 xen/common/sched_credit.c --- a/xen/common/sched_credit.c Fri Jun 05 11:37:04 2009 +0100 +++ b/xen/common/sched_credit.c Fri Jun 05 11:38:43 2009 +0100 @@ -363,15 +363,29 @@ static int csched_cpu_pick(struct vcpu *vc) { - cpumask_t cpus; + cpumask_t cpus, cpus_avoid_same_domain; cpumask_t idlers; int cpu; + struct vcpu *vp; /* * Pick from online CPUs in VCPU's affinity mask, giving a * preference to its current processor if it's in there. */ cpus_and(cpus, cpu_online_map, vc->cpu_affinity); + + /* Avoid putting vcpus from the same domain on the same cpu */ + cpus_avoid_same_domain=cpus; + for_each_vcpu( vc->domain, vp ) + { + if(vp == vc) + continue; + cpu_clear(vp->processor, cpus_avoid_same_domain); + } + + if( !cpus_empty(cpus_avoid_same_domain) ) + cpus = cpus_avoid_same_domain; + cpu = cpu_isset(vc->processor, cpus) ? vc->processor : cycle_cpu(vc->processor, cpus);