From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v4 03/15] libxl: introduce libxl_get_nr_cpus() Date: Tue, 3 Dec 2013 19:26:00 +0100 Message-ID: <1386095160.5338.357.camel@Solace> References: <20131122183332.11200.20231.stgit@Solace> <20131122185658.11200.13074.stgit@Solace> <21150.6530.28766.823281@mariner.uk.xensource.com> <1386093157.5338.337.camel@Solace> <21150.6842.156846.991072@mariner.uk.xensource.com> <529E1E46.2060106@eu.citrix.com> <20131203181703.GA21248@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8139220141324533464==" Return-path: In-Reply-To: <20131203181703.GA21248@phenom.dumpdata.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: Konrad Rzeszutek Wilk Cc: Marcus Granado , Keir Fraser , Ian Campbell , Li Yechen , George Dunlap , Andrew Cooper , Juergen Gross , Ian Jackson , xen-devel@lists.xen.org, Jan Beulich , Justin Weaver , Matt Wilson , Elena Ufimtseva List-Id: xen-devel@lists.xenproject.org --===============8139220141324533464== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-EZQJ1P+5XC06AL912/05" --=-EZQJ1P+5XC06AL912/05 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable `On mar, 2013-12-03 at 13:17 -0500, Konrad Rzeszutek Wilk wrote: > On Tue, Dec 03, 2013 at 06:09:10PM +0000, George Dunlap wrote: > > On 12/03/2013 05:54 PM, Ian Jackson wrote: > > >Dario Faggioli writes ("Re: [PATCH v4 03/15] libxl: introduce libxl_ge= t_nr_cpus()"): > > >>On mar, 2013-12-03 at 17:48 +0000, Ian Jackson wrote: > > >>>This number might be out of date as soon as it is read, won't it ? > > >> > > >>Quite possible, yes. > > >> > > >>So, are you suggesting that we shouldn't even allow the user to read = it? > > >>Or that I should mention that in the comment? (Or something else?) > > > > > >Perhaps I didn't explain my concerns clearly enough. > > > > > >I wonder what is it for ? Isn't it difficult to use correctly ? > >=20 > > Dario uses it in the new version of libxl_vcpu_set_affinity() to > > limit what was considered an "unreachable cpu" in its warning. (v5 > > 14/17) That is, if you set the affinity to > > 1111111111111111111111..., and there are only 4 pcpus, it will > > return 111100000..... These don't match, and yet there are no > > unreachable cpus. So it asks nr_cpus first, then only compares bits > > 1..[nr_cpus-1]. >=20 > What about the inverse? 2 PCPUs and 16 VCPUS? Won't that still throw > this calculation off? > It's not how it works, it's not the number of vcpus against pcpus that matters. So, as soon as your 16 vcpus have affinity with some _real_, _existing_ and _online_ pcpus, that would be fine and this situation you're mentioning won't cause any problem. OTOH, if you offline any of the pcpus in the process, no matter how many pcpus-vs-vcpus you have, you risk getting a spurious warning (and only that). Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-EZQJ1P+5XC06AL912/05 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) iEYEABECAAYFAlKeIjgACgkQk4XaBE3IOsQHbgCgj3/zTw4gTrKRQD9ADBo/HCwY 83wAnRyQLjhvaumOLwnSXPJqlfkkpgsz =k4k+ -----END PGP SIGNATURE----- --=-EZQJ1P+5XC06AL912/05-- --===============8139220141324533464== 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 --===============8139220141324533464==--