aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_credit.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-03-14 17:19:47 +0000
committerJan Beulich <jbeulich@novell.com>2011-03-14 17:19:47 +0000
commit32084d00161c849be2c812b1d2ef8b2ce0cbd783 (patch)
tree7d49b33b1fa41d1bb0ef93e6efe3a145e729be17 /xen/common/sched_credit.c
parent58a83b75d17c4346f0f8f20f9815e00d6f6ed5f1 (diff)
downloadxen-32084d00161c849be2c812b1d2ef8b2ce0cbd783.tar.gz
xen-32084d00161c849be2c812b1d2ef8b2ce0cbd783.tar.bz2
xen-32084d00161c849be2c812b1d2ef8b2ce0cbd783.zip
_csched_cpu_pick(): don't write idle bias more than once
For the bias to be really meaningful, it should be updated only when the CPU selected will indeed be returned (and hence used for placing the vCPU in question). Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/common/sched_credit.c')
-rw-r--r--xen/common/sched_credit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index bfdd567e3e..1d4d423620 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -464,6 +464,7 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
cpumask_t cpus;
cpumask_t idlers;
cpumask_t *online;
+ struct csched_pcpu *spc = NULL;
int cpu;
/*
@@ -531,9 +532,8 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
&& (weight_cpu * migrate_factor < weight_nxt) ) )
{
cpus_and(nxt_idlers, cpus, nxt_idlers);
- cpu = cycle_cpu(CSCHED_PCPU(nxt)->idle_bias, nxt_idlers);
- if ( commit )
- CSCHED_PCPU(nxt)->idle_bias = cpu;
+ spc = CSCHED_PCPU(nxt);
+ cpu = cycle_cpu(spc->idle_bias, nxt_idlers);
cpus_andnot(cpus, cpus, per_cpu(cpu_sibling_map, cpu));
}
else
@@ -542,6 +542,9 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
}
}
+ if ( commit && spc )
+ spc->idle_bias = cpu;
+
return cpu;
}