xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	andrew.cooper3@citrix.com
Subject: Re: [PATCH for 4.6 v3 2/3] xl/libxl: disallow saving a guest with vNUMA configured
Date: Thu, 10 Sep 2015 17:53:35 +0100	[thread overview]
Message-ID: <1441904015.3549.5.camel@citrix.com> (raw)
In-Reply-To: <20150910161515.GG1695@zion.uk.xensource.com>

On Thu, 2015-09-10 at 17:15 +0100, Wei Liu wrote:
> On Thu, Sep 10, 2015 at 05:10:57PM +0100, Ian Campbell wrote:
> > On Thu, 2015-09-10 at 15:50 +0100, Wei Liu wrote:
> > > This is because the migration stream does not preserve node
> > > information.
> > > 
> > > Note this is not a regression for migration v2 vs legacy migration
> > > because neither of them preserve node information.
> > > 
> > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > > ---
> > > Cc: andrew.cooper3@citrix.com
> > > 
> > > v3:
> > > 1. Update manpage, code comment and commit message.
> > > 2. *Don't* check if nomigrate is set.
> > > ---
> > >  docs/man/xl.cfg.pod.5   |  2 ++
> > >  tools/libxl/libxl_dom.c | 14 ++++++++++++++
> > >  2 files changed, 16 insertions(+)
> > > 
> > > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> > > index 80e51bb..555f8ba 100644
> > > --- a/docs/man/xl.cfg.pod.5
> > > +++ b/docs/man/xl.cfg.pod.5
> > > @@ -263,6 +263,8 @@ virtual node.
> > >  
> > >  Note that virtual NUMA for PV guest is not yet supported, because
> > >  there is an issue with cpuid handling that affects PV virtual NUMA.
> > > +Further more, guest with virtual NUMA cannot be saved or migrated
> > > +because migration stream does not preserve node information.
> > >  
> > >  Each B<VNODE_SPEC> is a list, which has a form of
> > >  "[VNODE_CONFIG_OPTION,VNODE_CONFIG_OPTION, ... ]"  (without quotes).
> > > diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> > > index c2518a3..a4d37dc 100644
> > > --- a/tools/libxl/libxl_dom.c
> > > +++ b/tools/libxl/libxl_dom.c
> > > @@ -24,6 +24,7 @@
> > >  #include <xen/hvm/hvm_info_table.h>
> > >  #include <xen/hvm/hvm_xs_strings.h>
> > >  #include <xen/hvm/e820.h>
> > > +#include <xen/errno.h>
> > >  
> > >  libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
> > >  {
> > > @@ -1612,6 +1613,7 @@ void libxl__domain_save(libxl__egc *egc,
> > > libxl__domain_suspend_state *dss)
> > >      const libxl_domain_remus_info *const r_info = dss->remus;
> > >      libxl__srm_save_autogen_callbacks *const callbacks =
> > >          &dss->sws.shs.callbacks.save.a;
> > > +    unsigned int nr_vnodes = 0, nr_vmemranges = 0, nr_vcpus = 0;
> > >  
> > >      dss->rc = 0;
> > >      logdirty_init(&dss->logdirty);
> > > @@ -1636,6 +1638,18 @@ void libxl__domain_save(libxl__egc *egc,
> > > libxl__domain_suspend_state *dss)
> > >            | (debug ? XCFLAGS_DEBUG : 0)
> > >            | (dss->hvm ? XCFLAGS_HVM : 0);
> > >  
> > > +    /* Disallow saving a guest with vNUMA configured because
> > > migration
> > > +     * stream does not preserve node information.
> > > +     */
> > > +    rc = xc_domain_getvnuma(CTX->xch, domid, &nr_vnodes,
> > > &nr_vmemranges,
> > > +                            &nr_vcpus, NULL, NULL, NULL);
> > > +    assert(rc == -1 && (errno == XEN_ENOBUFS || errno ==
> > > XEN_EOPNOTSUPP));
> > 
> > Has this been tested with a domain _without_ vnuma config.
> > 
> 
> Yes.
> 
> > Specifically if there is no vnuma config and therefore 0 vnodes and 0
> > vmemranges will the hypervisor actually return XEN_ENOBUFS rather than
> > success (because it succeeded to put 0 things into a zero length
> > array).
> > 
> 
> If there is no vnuma configuration at all, hv returns XEN_EOPNOTSUPP
> (hence the assertion in code).

Ah, I took that to be "Xen cannot do vnuma at all", rather than "This
particular domain has no vnuma".

> > It looks like the non-zero number of vcpus in the domain will indeed
> 
> I guess you meant "zero number"?

No, I meant non-zero. A domain with no vnuma still has some vcpus I think.
Hence the NULL for the vcpus_to_vnodes array would trigger XEN_ENOBUFS.

  reply	other threads:[~2015-09-10 16:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 14:50 [PATCH for 4.6 v3 0/3] More vNUMA patches Wei Liu
2015-09-10 14:50 ` [PATCH for 4.6 v3 1/3] libxc: introduce xc_domain_getvnuma Wei Liu
2015-09-10 14:50 ` [PATCH for 4.6 v3 2/3] xl/libxl: disallow saving a guest with vNUMA configured Wei Liu
2015-09-10 16:10   ` Ian Campbell
2015-09-10 16:15     ` Wei Liu
2015-09-10 16:53       ` Ian Campbell [this message]
2015-09-10 17:05         ` Wei Liu
2015-09-11 10:50           ` Ian Campbell
2015-09-11 13:21             ` Ian Campbell
2015-09-11 13:43               ` Wei Liu
2015-09-11 13:59                 ` Ian Campbell
2015-09-11 14:11                   ` Wei Liu
2015-09-10 14:50 ` [PATCH for 4.6 v3 3/3] xl: handle empty vnuma configuration Wei Liu
2015-09-10 15:35   ` Ian Campbell

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=1441904015.3549.5.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).