All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xensource.com>
To: "Tian, Kevin" <kevin.tian@intel.com>, xen-devel@lists.xensource.com
Subject: Re: [PATCH] trivial fix for vcpu_set_affinity
Date: Thu, 11 Jan 2007 09:43:47 +0000	[thread overview]
Message-ID: <C1CBB753.7748%keir@xensource.com> (raw)
In-Reply-To: <D470B4E54465E3469E2ABBC5AFAC390F9E1074@pdsmsx412.ccr.corp.intel.com>

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@intel.com> 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@intel.com>
> 
> 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@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2007-01-11  9:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11  8:42 [PATCH] trivial fix for vcpu_set_affinity Tian, Kevin
2007-01-11  9:43 ` Keir Fraser [this message]
2007-01-11  9:53   ` Tian, Kevin
2007-01-11  9:49 ` Emmanuel Ackaouy
2007-01-11  9:57   ` Tian, Kevin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C1CBB753.7748%keir@xensource.com \
    --to=keir@xensource.com \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.