From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, lccycc123@gmail.com, Elena Ufimtseva <ufimtseva@gmail.com>, xen-devel <xen-devel@lists.xenproject.org>, Ian.Campbell@citrix.com, msw@linux.com, ian.jackson@eu.citrix.com, keir@xen.org
Subject: Re: [Xen-devel] [PATCH v3 1/7] xen: vNUMA support for PV guests
Date: Tue, 19 Nov 2013 16:42:52 +0100
Message-ID: <1384875772.15360.6.camel@Solace>

[ Retrieve Raw Message; Archives: marc.info, gmane ]

[Part 1 (text/plain, inline)]
On mar, 2013-11-19 at 14:48 +0000, Jan Beulich wrote:
> >>> On 19.11.13 at 15:35, Dario Faggioli <dario.faggioli@citrix.com> wrote:
> > If I understand correctly what you're asking, the (current) answer is in
> > the Linux patch, here:
> > 
> >  
> > http://bugs.xenproject.org/xen/mid/%3C1384811922-14642-2-git-send-email-ufimt 
> > seva@gmail.com%3E
> > 
> > which uses num_possible_cpus()
> > 
> >  http://lxr.linux.no/linux+v3.12/+code=num_possible_cpus 
> > 
> > to size all the three arrays.
> 
> But what guarantees num_possible_cpus() to be larger than some
> hypervisor internal variables that the domain has no knowledge
> about? 
>
Nothing, I guess.

> Just consider a guest with a Linux configured for just 4
> CPUs and 2 nodes, but having a config file specifying 16 vCPU-s on
> 4 virtual nodes?
> 
That's a fair point. I can't remember the rationale behind the choice of
using num_possible_cpus()... ISTR some very early version (probably not
even shared on xen-devel) of the series using something like NR_CPUS,
but that would suffer from the same issue, I think.

Probably, we just overlooked the situation you're describing and though
that, given we don't allow nr_vcpus > nr_vnodes, using
num_possible_cpus() ought to be enough. But I see it now.

So, what would the best option be? Another hypercall (or a special way
of calling this one) "just" to retrieve the number of vnodes?

Thanks and Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[signature.asc (application/pgp-signature, inline)]
[Part 3 (text/plain, inline)]