[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 Wed, 2013-11-20 at 15:50 +0100, Dario Faggioli wrote:
> On mer, 2013-11-20 at 12:26 +0000, Ian Campbell wrote:
> > On Wed, 2013-11-20 at 13:18 +0100, Dario Faggioli wrote:
> > > After going down to Xen and then back from there, i.e., what happens to
> > > ecpumap, the "all" from above has become, again on my system, where I
> > > have 16 cpus, something like "0-15". That is, looking at the bits in the
> > > actual uint, the first 16 of them to 1, the other to 0.
> > 
> > And the returned bitmap doesn't have a size == 16? That's not very
> > helpful I suppose.
> > 
> Where? I mean what size are you talking about? In libxl, it is libxl
> itself that allocates the bitmap and decides, at allocation time (with
> the third parameter of libxl_cpu_bitmap_alloc()) how many bits I want
> there, and nothing changes that. So, after having allocated a cpumap 64
> bits big, there is no way it can tell that only 16 are worth.
> I can allocate the cpumap more precisely but, for one, that would still
> require figuring out the actual number of pcpus. Also, that would work
> for 16, but for any other value that is not multiple of sizeof(uint8_t),
> I'd have to face the same problem.

Oh, OK. I figured max_cpu would be stashed there somewhere.

> > It seems like it should be quite quick to wire up xc_get_nr_cpus based
> > on xc_get_max_cpus and use that.
> > 
> No it's not. On it.


> > Is there not a race condition here somewhere -- what happens if a CPU is
> > on/offlined during all this?
> > 
> Again, I'm not getting. What's the window where you're worried about
> races, if on/offlining is involved? What do you refer to with "during
> all this" ?

Between getting the maximum cpu number and checking the results of a pin
call. What happens if a CPU went away such that you think when checking
that there is 16 cpus (based on old information) but when the pin
hypercall was made there were only 15. Or conversely if a CPU was
plugged in.

Also, does this check fail if the cpumask is sparse? Is that something
which can happen e.g. unplugging CPU#8 in a 16 CPU system?


Xen-devel mailing list



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