From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH RESEND 02/12] xl: allow for node-wise specification of vcpu pinning Date: Wed, 6 Nov 2013 09:48:39 +0100 Message-ID: <1383727719.9207.67.camel@Solace> References: <20131105142844.30446.78671.stgit@Solace> <20131105143424.30446.56692.stgit@Solace> <527905CF.5060603@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0838696726754830086==" Return-path: In-Reply-To: <527905CF.5060603@eu.citrix.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: George Dunlap Cc: Marcus Granado , Keir Fraser , Ian Campbell , Li Yechen , Andrew Cooper , Juergen Gross , Ian Jackson , xen-devel@lists.xen.org, Jan Beulich , Justin Weaver , Daniel De Graaf , Matt Wilson , Elena Ufimtseva List-Id: xen-devel@lists.xenproject.org --===============0838696726754830086== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-u9HMzYLwFZ85hSNutk/7" --=-u9HMzYLwFZ85hSNutk/7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On mar, 2013-11-05 at 14:50 +0000, George Dunlap wrote: > On 11/05/2013 02:34 PM, Dario Faggioli wrote: > > Making it possible to use something like the following: > > * "nodes:0-3": all pCPUs of nodes 0,1,2,3; > > * "nodes:0-3,^node:2": all pCPUS of nodes 0,1,3; > > * "1,nodes:1-2,^6": pCPU 1 plus all pCPUs of nodes 1,2 > > but not pCPU 6; > > * ... > > > > In both domain config file and `xl vcpu-pin'. > > > > Signed-off-by: Dario Faggioli >=20 > Overall looks like a pretty clean patch; just a few comments. >=20 Ok. > > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 > > > > -To allow all the vcpus of the guest to run on cpus 0,2,3,5. > > +To allow all the vcpus of the guest to run on cpus 0,2,3,5. Combining > > +this with "all" is possible, meaning "all,^7" results in all the vcpus > > +of the guest running on all the cpus on the host except cpu 7. > > + > > +=3Ditem "nodes:0-3,node:^2" >=20 > Here you use both "nodes" and "node", while the code seems to only check= =20 > for "nodes". =20 > Right... This was a leftover from a previous version where I was actually checking for both, as well as trying to enforce singular/plural consistency (which, I agree with you) is overkill. > I was originally going to say we should just check one;=20 > but on the other hand, it's just an extra string compare -- I feel like= =20 > we might as well accept either "node" or "nodes". (No need to enforce= =20 > plurality: "nodes:2" and "node:1-3" should both be fine with me.) >=20 Right, I'll add the support for both then. > > +static int update_cpumap_range(const char *str, libxl_bitmap *cpumap) > > { > > - libxl_bitmap exclude_cpumap; > > - uint32_t cpuida, cpuidb; > > - char *endptr, *toka, *tokb, *saveptr =3D NULL; > > - int i, rc =3D 0, rmcpu; > > + unsigned long ida, idb; > > + libxl_bitmap node_cpumap; > > + bool is_not =3D false, is_nodes =3D false; > > + int rc =3D 0; > > + > > + libxl_bitmap_init(&node_cpumap); > > > > - if (!strcmp(cpu, "all")) { > > + rc =3D libxl_node_bitmap_alloc(ctx, &node_cpumap, 0); > > + if (rc) { > > + fprintf(stderr, "libxl_node_bitmap_alloc failed.\n"); > > + goto out; > > + } > > + > > + /* Are we adding or removing cpus/nodes? */ > > + if (STR_SKIP_PREFIX(str, "^")) { > > + is_not =3D true; > > + } > > + > > + /* Are we dealing with cpus or full nodes? */ > > + if (STR_SKIP_PREFIX(str, "nodes:")) { > > + is_nodes =3D true; > > + } > > + > > + if (STR_HAS_PREFIX(str, "all")) { >=20 > Is there any reason not to keep this "strcmp"? As it is, this will=20 > accept any string that *starts* with "all", which isn't exactly what you= =20 > want, I don't think. >=20 Ah, true... I'll revert this to strcmp(). Thanks and Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-u9HMzYLwFZ85hSNutk/7 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) iEYEABECAAYFAlJ6AmcACgkQk4XaBE3IOsQ7MwCePfswzbM2BVf9c7FFxl5p0Tey R40AoJ5ULsroAKissnUUyfz7G0/M05/I =hpRq -----END PGP SIGNATURE----- --=-u9HMzYLwFZ85hSNutk/7-- --===============0838696726754830086== 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 --===============0838696726754830086==--