From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2 11/16] libxc: get and set soft and hard affinity Date: Thu, 14 Nov 2013 17:18:30 +0100 Message-ID: <1384445910.29902.161.camel@Abyss> References: <20131113190852.18086.5437.stgit@Solace> <20131113191242.18086.73258.stgit@Solace> <21124.58652.304486.159299@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2930087222565122006==" Return-path: In-Reply-To: <21124.58652.304486.159299@mariner.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 Jackson Cc: Marcus Granado , Keir Fraser , Ian Campbell , Li Yechen , George Dunlap , Andrew Cooper , Juergen Gross , xen-devel@lists.xen.org, Jan Beulich , Justin Weaver , Matt Wilson , Elena Ufimtseva List-Id: xen-devel@lists.xenproject.org --===============2930087222565122006== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-2cuny7prj46uIZteRlRq" --=-2cuny7prj46uIZteRlRq Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On gio, 2013-11-14 at 14:58 +0000, Ian Jackson wrote: > Dario Faggioli writes ("[PATCH v2 11/16] libxc: get and set soft and hard= affinity"): > > @@ -206,39 +209,119 @@ int xc_vcpu_setaffinity(xc_interface *xch, > > goto out; > > } > > =20 > > - local =3D xc_hypercall_buffer_alloc(xch, local, cpusize); > > - if ( local =3D=3D NULL ) > > + cpumap_local =3D xc_hypercall_buffer_alloc(xch, cpumap_local, cpus= ize); >=20 > Is xc_hypercall_buffer_free idempotent, and is there a way to init a > hypercall buffer to an unallocated state ? If so this function could > be a lot simpler, and it could in particular more clearly not leak > anything, by using the "goto out" cleanup style. >=20 When I put this together, I followed suit from similar cases (actually, this is mostly renaming the function and adding a new parameter). This to say that I don't think it can be done much differently, but yes, I will check. > > +/** > > + * This functions specify the scheduling affinity for a vcpu. Soft > > + * affinity is on what pcpus a vcpu prefers to run. Hard affinity is > > + * on what pcpus a vcpu is allowed to run. When set independently (by > > + * the respective _soft and _hard calls) the effective affinity is > > + * also returned. What we call the effective affinity it the intersect= ion > > + * of soft affinity, hard affinity and the set of the cpus of the cpup= ool > > + * the domain belongs to. It's basically what the Xen scheduler will > > + * actually use. Returning it to the caller allows him to check if tha= t > > + * matches with, or at least is good enough for, his purposes. > > + * > > + * A xc_vcpu_setaffinity() call is provided, mainly for backward > > + * compatibility reasons, and what it does is setting both hard and > > + * soft affinity for the vcpu. > > + * > > + * @param xch a handle to an open hypervisor interface. > > + * @param domid the id of the domain to which the vcpu belongs > > + * @param vcpu the vcpu id wihin the domain > > + * @param cpumap the (hard, soft, both) new affinity map one wants to = set > > + * @param ecpumap the effective affinity for the vcpu >=20 > Either the doc comment, or the parameter name, should make it clear > that ecpumap is an out parameter. >=20 Ok, will do. 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) --=-2cuny7prj46uIZteRlRq 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) iEYEABECAAYFAlKE99YACgkQk4XaBE3IOsTAtgCfXDb9f6a0Nx4A16x8WnZODKuP dPsAn3MalwGgVUbq2FL949mlqzF7a4H2 =6ipU -----END PGP SIGNATURE----- --=-2cuny7prj46uIZteRlRq-- --===============2930087222565122006== 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 --===============2930087222565122006==--