[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 11/16] libxc: get and set soft and hard affinity
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; > > } > > > > - local = xc_hypercall_buffer_alloc(xch, local, cpusize); > > - if ( local == NULL ) > > + cpumap_local = xc_hypercall_buffer_alloc(xch, cpumap_local, cpusize); > > 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. > 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 intersection > > + * of soft affinity, hard affinity and the set of the cpus of the cpupool > > + * the domain belongs to. It's basically what the Xen scheduler will > > + * actually use. Returning it to the caller allows him to check if that > > + * 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 > > Either the doc comment, or the parameter name, should make it clear > that ecpumap is an out parameter. > Ok, will do. Thanks and Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |