diff -r 121d3e592294 xen/common/sched_credit.c --- a/xen/common/sched_credit.c Wed Aug 15 14:33:28 2007 +0100 +++ b/xen/common/sched_credit.c Tue Aug 21 11:14:46 2007 +0100 @@ -418,15 +418,29 @@ static int 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);