aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/schedule.c
diff options
context:
space:
mode:
authorGeorge Dunlap <george.dunlap@eu.citrix.com>2011-04-27 13:36:15 +0100
committerGeorge Dunlap <george.dunlap@eu.citrix.com>2011-04-27 13:36:15 +0100
commitff38d3faa7d0e1734237e81c2fea95e18c510dcd (patch)
tree7589a305a45183a0eb2b2ba61dbd91276a6dd17f /xen/common/schedule.c
parent9841d94c95bf97c3cd3c9ca14170fc88dc3b8305 (diff)
downloadxen-ff38d3faa7d0e1734237e81c2fea95e18c510dcd.tar.gz
xen-ff38d3faa7d0e1734237e81c2fea95e18c510dcd.tar.bz2
xen-ff38d3faa7d0e1734237e81c2fea95e18c510dcd.zip
credit2: add a callback to migrate to a new cpu
In credit2, there needs to be a strong correlation between v->processor and the runqueue to which a vcpu is assigned; much of the code relies on this invariant. Allow credit2 to manage the actual migration itself. This fixes the most recent credit2 bug reported on the list (Xen BUG at sched_credit2.c:1606) in Xen 4.1, as well as the bug at sched_credit2.c:811 in -unstable (which catches the same condition earlier). Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Diffstat (limited to 'xen/common/schedule.c')
-rw-r--r--xen/common/schedule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index dde615ee66..aa8bdd5969 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -489,7 +489,11 @@ static void vcpu_migrate(struct vcpu *v)
* Switch to new CPU, then unlock new and old CPU. This is safe because
* the lock pointer cant' change while the current lock is held.
*/
- v->processor = new_cpu;
+ if ( VCPU2OP(v)->migrate )
+ SCHED_OP(VCPU2OP(v), migrate, v, new_cpu);
+ else
+ v->processor = new_cpu;
+
if ( old_lock != new_lock )
spin_unlock(new_lock);