From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v4 13/15] xl: enable getting and setting soft Date: Mon, 2 Dec 2013 19:10:46 +0100 Message-ID: <1386007846.5338.213.camel@Solace> References: <20131122183332.11200.20231.stgit@Solace> <20131122185824.11200.88571.stgit@Solace> <1385564255.30237.30.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2816262287397681987==" Return-path: In-Reply-To: <1385564255.30237.30.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 , Jan Beulich , Li Yechen , George Dunlap , Andrew Cooper , Juergen Gross , Ian Jackson , xen-devel@lists.xen.org, Matt Wilson , Justin Weaver , Elena Ufimtseva List-Id: xen-devel@lists.xenproject.org --===============2816262287397681987== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-+m2iRn7XW1lC3aeVNhqz" --=-+m2iRn7XW1lC3aeVNhqz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On mer, 2013-11-27 at 14:57 +0000, Ian Campbell wrote: > On Fri, 2013-11-22 at 19:58 +0100, Dario Faggioli wrote: > > --- a/tools/libxl/xl_cmdimpl.c > > +++ b/tools/libxl/xl_cmdimpl.c > > @@ -4630,23 +4649,29 @@ static int vcpupin(uint32_t domid, const char *= vcpu, char *cpu) > > } > > =20 > > if (vcpuid !=3D -1) { > > - if (libxl_set_vcpuaffinity(ctx, domid, vcpuid, &cpumap, NULL))= { > > - fprintf(stderr, "Could not set affinity for vcpu `%u'.\n",= vcpuid); > > + if (!soft_affinity && > > + libxl_set_vcpuaffinity(ctx, domid, vcpuid, &cpumap, NULL))= { > > + fprintf(stderr, "Could not set hard affinity for vcpu `%u'= .\n", > > + vcpuid); > > + goto out; > > + } else if (soft_affinity && > > + libxl_set_vcpuaffinity(ctx, domid, vcpuid, NULL, &c= pumap)) { > > + fprintf(stderr, "Could not set soft affinity for vcpu `%u'= .\n", > > + vcpuid); >=20 > I think I would have written this as: > libxl_bitmap *soft =3D NULL, *hard =3D NULL; > if (soft_affinity) > soft =3D &cpumap > else > hard =3D &cpumap >=20 > The in both of the branches "if (vcpu !=3D -1)": > libxl_set_vcpuaffinity(..., hard, soft) > error handling >=20 > I think you can omit the soft/hard from the log message other logging > and/or the fact that they know what they asked for will cover the > distinction. If you really wanted the const char *what =3D soft_affinity = ? > "soft" : "hard" to use. >=20 Done this, and all the that was suggested in this e-mail. > Is there no option to set both? >=20 No, not for now. Do you think there should be one? Personally, I think we should keep `xl vcpu-pin ' working, and doing the thing that people are most used with, i.e., setting the pinning (hard affinity). At that point, the most natural thing to do seemed to add a switch to have this deal with soft affinity, which is what happens in this patch. I of course can come up with pretty much all sort of behavior, e.g., setting both hard and soft affinity to the same cpumap, if no switch is provided, and then introduce both a '-h' and a '-s', for specifying different cpumaps, at the same time, etc. Of course, that could well happen during 4.5, I guess. :-P So, what do we want? Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-+m2iRn7XW1lC3aeVNhqz 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) iEYEABECAAYFAlKczSYACgkQk4XaBE3IOsRL/gCeJPyVgDe6KiYtDwENUNflKZj/ RY8An398iFojBSw+LE2Dt2n9Xr9FWT7j =Q0Ep -----END PGP SIGNATURE----- --=-+m2iRn7XW1lC3aeVNhqz-- --===============2816262287397681987== 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 --===============2816262287397681987==--