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

Re: [Xen-devel] [PATCH v2 12/16] libxl: get and set soft affinity



On 14/11/13 16:25, Ian Jackson wrote:
George Dunlap writes ("Re: [PATCH v2 12/16] libxl: get and set soft affinity"):
On 14/11/13 15:11, Ian Jackson wrote:
So perhaps we should have a singe function that can change the
cpupool, hard affinity, and soft affinity, all at once ?
I think this is probably a good idea.  Would it make sense to basically
have libxl_[gs]et_vcpuaffinity2(), which takes a parameter that can
specify that the mask is for either hard, soft, or both?
No, it needs to take at least two separate parameters for the hard and
soft masks, because the toolstack might want to set the hard affinity
and soft affinity to different values, without having to think
carefully about ordering these calls to avoid generating spurious
warnings and incompatible arrangements.

I think this probably applies to cpupool changes too.  So perhaps the
function should look a bit like setresuid or something: it should take
an optional new cpupool (is there a sentinel value that can be used to
mean "no change"?), an optional new soft mask, and an optional new
hard mask.

What if the application makes a call to change the cpupool, without
touching the affinities ?  Should the affinities be reset
automatically ?
I think whatever happens for hard affinities right now should be carried on.
Maybe it is a bug that it doesn't do anything.  I think it depends how
we expect people to use this.  If a caller sets the hard affinities
and then changes the cpupool, are they supposed to always then set the
hard affinities again to a new suitable value ?

Well in fact, as far as I can tell, it *does* do something. When moving a vcpu to a new pool, it unconditionally calls cpumask_setall(v->cpu_affinity) for each vcpu, which will effectively erase the hard affinity. (xen/common/schedule.c:sched_move_domain()).

And, when unplugging cpus, if it unplugs the last cpu a vcpu can run on, it also resets the affinity to "all".

 -George



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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