From: Dario Faggioli <raistlin@linux.it>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Andre Przywara <andre.przywara@amd.com>,
Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Juergen Gross <juergen.gross@ts.fujitsu.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 03 of 10 v2] libxl, libxc: introduce libxl_get_numainfo()
Date: Thu, 21 Jun 2012 12:00:14 +0200 [thread overview]
Message-ID: <1340272814.4856.16.camel@Solace> (raw)
In-Reply-To: <1340269342.21872.20.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 3380 bytes --]
On Thu, 2012-06-21 at 10:02 +0100, Ian Campbell wrote:
> > diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
> > --- a/tools/libxc/xenctrl.h
> > +++ b/tools/libxc/xenctrl.h
> ...
> > +libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
> > +{
> [...]
>
> The hypercall buffer stuff all looks good.
>
> > + if (ret)
> > + *nr = max_nodes;
>
> You could put this before the fail: label. Not that it matters.
>
Ok.
> > diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> > --- a/tools/libxl/libxl.h
> > +++ b/tools/libxl/libxl.h
> ...
> > #define LIBXL_CPUTOPOLOGY_INVALID_ENTRY (~(uint32_t)0)
> > libxl_cputopology *libxl_get_cpu_topology(libxl_ctx *ctx, int *nr);
> > void libxl_cputopology_list_free(libxl_cputopology *, int nr);
> > +#define LIBXL_NUMAINFO_INVALID_ENTRY (~(uint32_t)0)
> > +libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr);
> > + /* On success, a list of nr libxl_numainfo elements is returned.
> > + * That is from malloc, thus it is up to the caller to invoke
> > + * libxl_cpupoolinfo_list_free() on it.
>
> Don't you mean libxl_numinfo_list_free() ?
>
> Also normally we put the comment before the prototype.
>
Yes, I did, and will fix it. For the comment, again, I'll move that
up... It's just you can find so much different "examples" in those
files... :-O
> > diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
> > --- a/tools/libxl/libxl_utils.c
> > +++ b/tools/libxl/libxl_utils.c
> > @@ -537,6 +537,11 @@ int libxl_get_max_cpus(libxl_ctx *ctx)
> > return xc_get_max_cpus(ctx->xch);
> > }
> >
> > +int libxl_get_max_nodes(libxl_ctx *ctx)
> > +{
> > + return xc_get_max_nodes(ctx->xch);
> > +}
>
> Is this needed externally to libxl or do we expect all callers to use
> libxl_get_numainfo? I suppose there is no harm in exporting this either
> way.
>
I'm not sure. What I did is to replicate what happens for
libxl_get_max_cpus(), but I really don't know whether or not they both
make any sense outside libxl. It does not look that bad to me that we
offer our users a chance to figure out how many cpus and/or nodes they
have, without needing to call the proper libxl_get_*info(), which is
quite a bit more of a burden. FWIW, I'd leave both of them public.
> > diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
> > --- a/xen/include/public/sysctl.h
> > +++ b/xen/include/public/sysctl.h
> > @@ -484,6 +484,7 @@ typedef struct xen_sysctl_topologyinfo x
> > DEFINE_XEN_GUEST_HANDLE(xen_sysctl_topologyinfo_t);
> >
> > /* XEN_SYSCTL_numainfo */
> > +#define INVALID_NUMAINFO_ID (~0U)
>
> It feels like there ought to be hunks in the hypervisor which either use
> this symbol instead of a hardcoded ~0U or which remove the internal
> definition in favour of this one?
>
Again, -topologyinfo machinery does exactly this, so I really think we
either fix/change or leave as they are both of them (which of course I
can do, just tell me if that is what you want).
Thanks and Regards,
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
next prev parent reply other threads:[~2012-06-21 10:00 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 17:04 [PATCH 00 of 10 v2] Automatic NUMA placement for xl Dario Faggioli
2012-06-15 17:04 ` [PATCH 01 of 10 v2] libxl: fix a typo in the GCREALLOC_ARRAY macro Dario Faggioli
2012-06-21 8:53 ` Ian Campbell
2012-06-26 16:00 ` Ian Campbell
2012-06-26 16:26 ` Dario Faggioli
2012-06-15 17:04 ` [PATCH 02 of 10 v2] libxl: add a new Array type to the IDL Dario Faggioli
2012-06-15 17:04 ` [PATCH 03 of 10 v2] libxl, libxc: introduce libxl_get_numainfo() Dario Faggioli
2012-06-21 9:02 ` Ian Campbell
2012-06-21 10:00 ` Dario Faggioli [this message]
2012-06-21 10:21 ` Ian Campbell
2012-06-15 17:04 ` [PATCH 04 of 10 v2] xl: add more NUMA information to `xl info -n' Dario Faggioli
2012-06-21 9:04 ` Ian Campbell
2012-06-15 17:04 ` [PATCH 05 of 10 v2] libxl: rename libxl_cpumap to libxl_bitmap Dario Faggioli
2012-06-21 9:12 ` Ian Campbell
2012-06-21 9:49 ` Dario Faggioli
2012-06-21 10:22 ` Ian Campbell
2012-06-15 17:04 ` [PATCH 06 of 10 v2] libxl: expand the libxl_bitmap API a bit Dario Faggioli
2012-06-21 9:30 ` Ian Campbell
2012-06-21 9:46 ` Dario Faggioli
2012-06-15 17:04 ` [PATCH 07 of 10 v2] libxl: introduce some node map helpers Dario Faggioli
2012-06-21 9:35 ` Ian Campbell
2012-06-21 9:44 ` Dario Faggioli
2012-06-15 17:04 ` [PATCH 08 of 10 v2] libxl: enable automatic placement of guests on NUMA nodes Dario Faggioli
2012-06-21 11:40 ` Ian Campbell
2012-06-21 16:34 ` Dario Faggioli
2012-06-22 10:14 ` Ian Campbell
2012-06-26 16:25 ` Dario Faggioli
2012-06-26 16:26 ` Ian Campbell
2012-06-26 17:23 ` Ian Jackson
2012-06-21 16:16 ` George Dunlap
2012-06-21 16:43 ` Dario Faggioli
2012-06-22 10:05 ` George Dunlap
2012-06-26 11:03 ` Ian Jackson
2012-06-26 15:20 ` Dario Faggioli
2012-06-27 8:15 ` Dario Faggioli
2012-06-28 7:25 ` Zhang, Yang Z
2012-06-28 8:36 ` George Dunlap
2012-06-29 5:38 ` Zhang, Yang Z
2012-06-29 9:46 ` Dario Faggioli
2012-06-28 10:12 ` Dario Faggioli
2012-06-28 12:41 ` Pasi Kärkkäinen
2012-06-28 17:03 ` Dario Faggioli
2012-06-29 5:29 ` Zhang, Yang Z
2012-06-29 9:38 ` Dario Faggioli
2012-06-15 17:04 ` [PATCH 09 of 10 v2] libxl: have NUMA placement deal with cpupools Dario Faggioli
2012-06-21 13:31 ` Ian Campbell
2012-06-21 13:54 ` Dario Faggioli
2012-06-21 13:58 ` Ian Campbell
2012-06-15 17:04 ` [PATCH 10 of 10 v2] Some automatic NUMA placement documentation Dario Faggioli
2012-06-18 15:54 ` Dario Faggioli
2012-06-21 13:38 ` Ian Campbell
2012-06-21 13:57 ` Dario Faggioli
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=1340272814.4856.16.camel@Solace \
--to=raistlin@linux.it \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=andre.przywara@amd.com \
--cc=juergen.gross@ts.fujitsu.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 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).