WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] trivial fix for vcpu_set_affinity

To: "Tian, Kevin" <kevin.tian@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] trivial fix for vcpu_set_affinity
From: Keir Fraser <keir@xxxxxxxxxxxxx>
Date: Thu, 11 Jan 2007 09:43:47 +0000
Delivery-date: Thu, 11 Jan 2007 01:43:29 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <D470B4E54465E3469E2ABBC5AFAC390F9E1074@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acc1XHnccgULlCvjTp6iKfUe1DX6iAACIOsv
Thread-topic: [Xen-devel] [PATCH] trivial fix for vcpu_set_affinity
User-agent: Microsoft-Entourage/11.2.5.060620
It's true that the vcpu_migrate() is a no-op if v==current, but the
vcpu_sleep_nosync() does have to be executed, otherwise current will not be
migrated before returning to guest context (because the schedule softirq
will not be asserted). This would mean that a dom0 vcpu could no longer
synchronously migrate itself. In any case this patch has no upside -- the
existing code works just fine.

 -- Keir

On 11/1/07 08:42, "Tian, Kevin" <kevin.tian@xxxxxxxxx> wrote:

> No need to try migration in current context since self migrate
> will be handled by next vcpu after context switch.
> 
> Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx>
> 
> diff -r e66f047bc97e xen/common/schedule.c
> --- a/xen/common/schedule.c Tue Jan 09 18:56:44 2007 -0800
> +++ b/xen/common/schedule.c Thu Jan 11 16:31:37 2007 +0800
> @@ -243,7 +243,7 @@ int vcpu_set_affinity(struct vcpu *v, cp
>  
>      vcpu_schedule_unlock_irqrestore(v, flags);
>  
> -    if ( test_bit(_VCPUF_migrating, &v->vcpu_flags) )
> +    if ( (v != current) && test_bit(_VCPUF_migrating, &v->vcpu_flags) )
>      {
>          vcpu_sleep_nosync(v);
>          vcpu_migrate(v);
> 
> Thanks,
> Kevin
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel