From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 11/14] libxl: get and set soft affinity Date: Wed, 20 Nov 2013 13:00:00 +0100 Message-ID: <1384948800.15360.65.camel@Solace> References: <20131118175544.31002.79574.stgit@Solace> <20131118181813.31002.61195.stgit@Solace> <1384881864.16252.48.camel@hastur.hellion.org.uk> <1384883478.19880.170.camel@Abyss> <1384946825.28441.56.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4763275623239263518==" Return-path: In-Reply-To: <1384946825.28441.56.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Marcus Granado , Keir Fraser , Matt Wilson , Li Yechen , George Dunlap , Andrew Cooper , Juergen Gross , Ian Jackson , xen-devel@lists.xen.org, Jan Beulich , Justin Weaver , Elena Ufimtseva List-Id: xen-devel@lists.xenproject.org --===============4763275623239263518== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-+ghZafJfpO4b7HwcU+38" --=-+ghZafJfpO4b7HwcU+38 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On mer, 2013-11-20 at 11:27 +0000, Ian Campbell wrote: > On Tue, 2013-11-19 at 18:51 +0100, Dario Faggioli wrote: > > Right, but don't I need a gc to use it? Should I "make up" one just for > > the purpose of using LOG/LOGE? >=20 > I think a call to GC_INIT/GC_FREE should be cheap enough. >=20 Fine then. > > > > + return ERROR_FAIL; > > > > + } > > > > + libxl_cputopology_list_free(topology, nr_cpus); > > >=20 > > > Why are you retrieving this only to immediately throw it away? > > >=20 > > Because I need nr_cpus. :-) >=20 > Surely this is not the recommended way to get nr_cpus! >=20 > libxl_get_cpu_topology() itself calls libxl_get_max_cpus() which seems > like the obvious candidate. >=20 Well, it does indeed, but then it (most likely) returns something different from what libxl_get_max_cpus() says. I fact, what it does is use the result of such call to size the arrays needed for calling xc_topologyinfo. Then, it takes what the call to xc_topologyinfo() returns in tinfo.max_cpu_index and returns that (increased by one, as that's the index rather than the number) to the caller. I think the difference is libxl_get_max_cpus() returns the maximum possible number of supported cpus, while libxl_get_cputopology() --thanks to the fact that it goes through xc_topologyinfo(), not (only) xc_get_max_cpus(), like libxl_get_max_cpus() does-- returns the actual number of cpus. What I need is the latter, and I'm looking again, but I'm again not finding anything easier (and, I agree, less ugly) than this to get it. I can go through libxl_get_physinfo(), rather than through _topologyinfo(), but the result is not going to be that different. I'll keep looking but, in case I really don't fine anything, do you want me to: - stick with this, at least for now; - introduce a new libxl (and probably libxc too) interface for this ? And I'm asking with this patch series in mind... I mean, I of course can add to my TODO list to do the latter, but do you think it's a prerequisite for accepting this patch? Just let me know. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-+ghZafJfpO4b7HwcU+38 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) iEYEABECAAYFAlKMpEAACgkQk4XaBE3IOsSfWgCgibjqCDqn2nx6SUsO1DBnaSoN GxMAoIzXQ7gtCeLaYJaqEFaVkC43c8/r =kLCN -----END PGP SIGNATURE----- --=-+ghZafJfpO4b7HwcU+38-- --===============4763275623239263518== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============4763275623239263518==--