From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH for Xen 4.6 3/5] tools/libxl: return socket id from libxl_psr_cat_get_l3_info Date: Mon, 28 Sep 2015 17:35:56 +0200 Message-ID: <1443454556.3276.98.camel@citrix.com> References: <1443441293-4287-1-git-send-email-chao.p.peng@linux.intel.com> <1443441293-4287-4-git-send-email-chao.p.peng@linux.intel.com> <20150928141356.GD13821@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7628442487124822133==" Return-path: In-Reply-To: <20150928141356.GD13821@zion.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: Wei Liu , Chao Peng , g@zion.uk.xensource.com Cc: xen-devel@lists.xen.org, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org --===============7628442487124822133== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ZUrV72fjNtIBF/6JBGcA" --=-ZUrV72fjNtIBF/6JBGcA Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2015-09-28 at 15:13 +0100, Wei Liu wrote: > On Mon, Sep 28, 2015 at 07:54:51PM +0800, Chao Peng wrote: > > diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c > > index 3378239..10e1113 100644 > > @@ -339,7 +339,8 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, > > libxl_psr_cat_info **info, > > { > > GC_INIT(ctx); > > int rc; > > - int i, nr_sockets; > > + int i =3D 0, socket, nr_sockets; > > + libxl_bitmap socketmap; > > libxl_psr_cat_info *ptr; > > =20 > > rc =3D libxl__count_physical_sockets(gc, &nr_sockets); > > @@ -348,21 +349,31 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, > > libxl_psr_cat_info **info, > > goto out; > > } >=20 > This is a path that you call libxl_bitmap_dispose on an uninitialised > socketmap. >=20 Yep. However, do we still need to go through libxl__count_physical_sockets() explicitly? AFAICS, you need it for allocating ptr, and for returning it back. But since now you're building the full bitmap, we can use libxl_bitmap_count_set(), for that. This may not be a bit deal, but if I'm not wrong, it saves us an hypercall (the PHYSINFO that libxl__count_physical_socket() issues). > > --- a/tools/libxl/libxl_types.idl > > +++ b/tools/libxl/libxl_types.idl > > @@ -792,6 +792,7 @@ libxl_psr_cbm_type =3D > > Enumeration("psr_cbm_type", [ > > ]) > > =20 > > libxl_psr_cat_info =3D Struct("psr_cat_info", [ > > + ("target_id", uint32), >=20 > Or just call it "socket_id"? Or even just "id" because you know this > structure is for socket? >=20 Yeah, we discussed this already, AFAICR. I think the point is that, at least in theory, these features may be extended to become more fine -grained than per-socket, hence the point of not binding the interface to sockets. That being said, FWIW, I'm fine either way. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-ZUrV72fjNtIBF/6JBGcA 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 iEYEABECAAYFAlYJXlwACgkQk4XaBE3IOsRxLACgpyU5JOMmRF7eIEqTjENCMBgv arMAnRgenrDW/v2LqVoHZ5ZJrfC6StME =GkZK -----END PGP SIGNATURE----- --=-ZUrV72fjNtIBF/6JBGcA-- --===============7628442487124822133== 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 --===============7628442487124822133==--