aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_credit.c
diff options
context:
space:
mode:
authorJuergen Gross <juergen.gross@ts.fujitsu.com>2011-02-25 11:28:15 +0000
committerJuergen Gross <juergen.gross@ts.fujitsu.com>2011-02-25 11:28:15 +0000
commit53582e3da009e5fa440cf47280bda2c1f92f2dfa (patch)
tree38f3718ee885fc7befe7b21b9cc93df30bcd5460 /xen/common/sched_credit.c
parenta0f5d3f3b7cdb44bb5d8f657efa1fa46008359ad (diff)
downloadxen-53582e3da009e5fa440cf47280bda2c1f92f2dfa.tar.gz
xen-53582e3da009e5fa440cf47280bda2c1f92f2dfa.tar.bz2
xen-53582e3da009e5fa440cf47280bda2c1f92f2dfa.zip
cpupool: Avoid race when moving cpu between cpupools
Moving cpus between cpupools is done under the schedule lock of the moved cpu. When checking a cpu being member of a cpupool this must be done with the lock of that cpu being held. Hot-unplugging of physical cpus might encounter the same problems, but this should happen only very rarely. Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Andre Przywara <andre.przywara@amd.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Diffstat (limited to 'xen/common/sched_credit.c')
-rw-r--r--xen/common/sched_credit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index b53c2ad31f..d4852fd707 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1268,7 +1268,8 @@ csched_load_balance(struct csched_private *prv, int cpu,
/*
* Any work over there to steal?
*/
- speer = csched_runq_steal(peer_cpu, cpu, snext->pri);
+ speer = cpu_isset(peer_cpu, *online) ?
+ csched_runq_steal(peer_cpu, cpu, snext->pri) : NULL;
pcpu_schedule_unlock(peer_cpu);
if ( speer != NULL )
{