aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/schedule.c
diff options
context:
space:
mode:
authorJuergen Gross <juergen.gross@ts.fujitsu.com>2011-02-10 09:02:50 +0000
committerJuergen Gross <juergen.gross@ts.fujitsu.com>2011-02-10 09:02:50 +0000
commit32e7954462cf4839deb1f268d37cc1639b16a0cc (patch)
treebe8a865da3fb4a5a55e01ed210b9a5f429f02cb5 /xen/common/schedule.c
parentebe3e6440ce49e51c41620161961c4b39c373276 (diff)
downloadxen-32e7954462cf4839deb1f268d37cc1639b16a0cc.tar.gz
xen-32e7954462cf4839deb1f268d37cc1639b16a0cc.tar.bz2
xen-32e7954462cf4839deb1f268d37cc1639b16a0cc.zip
Cpupools: vcpu affinity handling
If a vcpu is pinned to multiple physical cpus, the pinning is not removed if all those physical cpus are removed from the cpupool. When disabling the scheduler on a cpu, the affinity mask must be checked against the cpumask of the cpupool. Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Diffstat (limited to 'xen/common/schedule.c')
-rw-r--r--xen/common/schedule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 21509b6df1..5f192d272c 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -466,6 +466,7 @@ int cpu_disable_scheduler(unsigned int cpu)
struct domain *d;
struct vcpu *v;
struct cpupool *c;
+ cpumask_t online_affinity;
int ret = 0;
bool_t affinity_broken;
@@ -484,7 +485,8 @@ int cpu_disable_scheduler(unsigned int cpu)
{
vcpu_schedule_lock_irq(v);
- if ( (cpus_weight(v->cpu_affinity) == 1) &&
+ cpus_and(online_affinity, v->cpu_affinity, c->cpu_valid);
+ if ( cpus_empty(online_affinity) &&
cpu_isset(cpu, v->cpu_affinity) )
{
printk("Breaking vcpu affinity for domain %d vcpu %d\n",