From: "Jan Beulich" Subject: Re: [PATCH] xen: Always ask the scheduler to re-place the vcpu when the affinity changes Date: Mon, 04 Mar 2013 12:35:48 +0000 Message-ID: <5134A33402000078000C2CF1@nat28.tlf.novell.com> References: <1362399557-20214-1-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1362399557-20214-1-git-send-email-george.dunlap@eu.citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 04.03.13 at 13:19, George Dunlap wrote: > 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. > > Signed-off-by: George Dunlap > --- > xen/common/schedule.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/xen/common/schedule.c b/xen/common/schedule.c > index de11110..dbef5af 100644 > --- a/xen/common/schedule.c > +++ b/xen/common/schedule.c > @@ -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); > The code right below the context visible here is if ( test_bit(_VPF_migrating, &v->pause_flags) ) { vcpu_sleep_nosync(v); vcpu_migrate(v); } and I think the conditional could (and should) now be removed. Jan