From: Dario Faggioli <raistlin@linux.it>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] libxl: use xc_topologyinfo to figure out how many CPUs we actually have
Date: Wed, 09 May 2012 14:45:24 +0200 [thread overview]
Message-ID: <1336567524.2621.16.camel@Abyss> (raw)
In-Reply-To: <1336565074.25514.104.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 1830 bytes --]
On Wed, 2012-05-09 at 13:04 +0100, Ian Campbell wrote:
> On Wed, 2012-05-09 at 12:03 +0100, Darrio Faggioli wrote:
> > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > --- a/tools/libxl/libxl.c
> > +++ b/tools/libxl/libxl.c
> > @@ -2903,7 +2903,8 @@ libxl_cputopology *libxl_get_cpu_topolog
> > }
> >
> > for (i = 0; i < max_cpus; i++) {
> > -#define V(map, i) (map[i] == INVALID_TOPOLOGY_ID) ? \
> > +#define V(map, i) (i > tinfo.max_cpu_index || \
> > + map[i] == INVALID_TOPOLOGY_ID) ? \
>
> This ensures that cpus entries above max_cpu_index are
> INVALID_TOPOLOGY_ID
>
Yep, thus giving consumers of this call the chance to figure out what
the valid entries are. It looked the most natural way of doing this,
given output_topology (for instance) already check for
LIBXL_CPUTOPOLOGY_INVALID_ENTRY entries and skip them.
Also, the get-cpu-topology command in xenpm, which always worked
properly on my testbox, does exactly that.
> but do you also want to size the return array using
> tinfo.max_cpu_index too? And also return that in *nr instead of?
>
> (I don't know the answer, either of max-possible- and max-online-cpus is
> a reasonable size for this array)
>
Well, I really don't know either. This is the minimum impact working
version. For sure, I'd like very much to return that value via *nr, as
it will give me something more sensible to work with... You know what,
I'm sending a patch doing exactly that, as I think what you're
suggesting is actually better.
Thanks,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
prev parent reply other threads:[~2012-05-09 12:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 11:03 [PATCH] libxl: use xc_topologyinfo to figure out how many CPUs we actually have Darrio Faggioli
2012-05-09 11:11 ` Dario Faggioli
2012-05-09 15:23 ` Ian Jackson
2012-05-10 9:26 ` Dario Faggioli
2012-05-09 12:04 ` Ian Campbell
2012-05-09 12:45 ` Dario Faggioli [this message]
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=1336567524.2621.16.camel@Abyss \
--to=raistlin@linux.it \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xen.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 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.