Skip to contentSkip to conversation

xen: Always ask the scheduler to re-place the vcpu when the affinity changes

PATCH New George Dunlap 1 participant 1 message Mar 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xen: Always ask the scheduler to re-place the vcpu when the affinity changes

It's probably a good idea to re-evaluate placement whenever the affinity changes.

This additionally has the benefit of removing scheduler-specific exceptions introduced in git c/s e6a6fd63.

The conditionals surrounding vcpu_migrate() are left pending a re-work of the logic to avoid the common case calling vcpu_migrate() twice (once here, and once in context_saved().

v2:
- Update commit message to explain conditionals

---
 xen/common/schedule.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
xen/common/schedule.c +4 -3
index de11110..dbef5af 100644
@@ -613,9 +613,10 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
     vcpu_schedule_lock_irq(v);
 
     cpumask_copy(v->cpu_affinity, affinity);
-    if ( VCPU2OP(v)->sched_id == XEN_SCHEDULER_SEDF ||
-         !cpumask_test_cpu(v->processor, v->cpu_affinity) )
-        set_bit(_VPF_migrating, &v->pause_flags);
+
+    /* Always ask the scheduler to re-evaluate placement
+     * when changing the affinity */
+    set_bit(_VPF_migrating, &v->pause_flags);
 
     vcpu_schedule_unlock_irq(v);
 
Signature · 1 line
1.7.9.5