[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 11/14] libxl: get and set soft affinity

On mer, 2013-11-20 at 11:27 +0000, Ian Campbell wrote:
> On Tue, 2013-11-19 at 18:51 +0100, Dario Faggioli wrote:
> > Right, but don't I need a gc to use it? Should I "make up" one just for
> > the purpose of using LOG/LOGE?
> I think a call to GC_INIT/GC_FREE should be cheap enough.
Fine then.

> > > > +        return ERROR_FAIL;
> > > > +    }
> > > > +    libxl_cputopology_list_free(topology, nr_cpus);
> > > 
> > > Why are you retrieving this only to immediately throw it away?
> > > 
> > Because I need nr_cpus. :-)
> Surely this is not the recommended way to get nr_cpus!
> libxl_get_cpu_topology() itself calls libxl_get_max_cpus() which seems
> like the obvious candidate.
Well, it does indeed, but then it (most likely) returns something
different from what libxl_get_max_cpus() says.

I fact, what it does is use the result of such call to size the arrays
needed for calling xc_topologyinfo. Then, it takes what the call to
xc_topologyinfo() returns in tinfo.max_cpu_index and returns that
(increased by one, as that's the index rather than the number) to the

I think the difference is libxl_get_max_cpus() returns the maximum
possible number of supported cpus, while libxl_get_cputopology()
--thanks to the fact that it goes through xc_topologyinfo(), not (only)
xc_get_max_cpus(), like libxl_get_max_cpus() does-- returns the actual
number of cpus.

What I need is the latter, and I'm looking again, but I'm again not
finding anything easier (and, I agree, less ugly) than this to get it.
I can go through libxl_get_physinfo(), rather than through
_topologyinfo(), but the result is not going to be that different.

I'll keep looking but, in case I really don't fine anything, do you want
me to:
 - stick with this, at least for now;
 - introduce a new libxl (and probably libxc too) interface for this


And I'm asking with this patch series in mind... I mean, I of course can
add to my TODO list to do the latter, but do you think it's a
prerequisite for accepting this patch?

Just let me know.


<<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
Description: This is a digitally signed message part

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.