From: Wei Liu Subject: Re: [PATCH 6/9] xl: enable using ranges of pCPUs when manipulating cpupools Date: Mon, 9 Mar 2015 10:51:58 +0000 Message-ID: <20150309105158.GI18491@zion.uk.xensource.com> References: <20150306170758.7269.53821.stgit@Solace.station> <20150306172142.7269.18049.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20150306172142.7269.18049.stgit@Solace.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: Juergen Gross , Wei Liu , Ian Campbell , Stefano Stabellini , Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org On Fri, Mar 06, 2015 at 06:21:42PM +0100, Dario Faggioli wrote: > in fact, right now, xl sub-commands 'cpupool-cpu-add' and > 'cpupool-cpu-remove' only accept the specification of one > pCPU to be added or removed to/from a cpupool. > > With this change, they can deal with ranges, like "4-8", > or "node:1,12-18,^14". The syntax is exactly the same one > that is supported by the 'vcpu-pin' subcommand, and > specifying just one pCPU still works, of course. > > This make things more flexible, more consistent, and also > improves error handling, as the pCPU range parsing routine > already present in xl is more reliable than just a call > to atoi(). > > Signed-off-by: Dario Faggioli > Cc: Ian Campbell > Cc: Ian Jackson > Cc: Stefano Stabellini > Cc: Wei Liu > Cc: Juergen Gross > --- > docs/man/xl.pod.1 | 25 ++++++++++-- > tools/libxl/xl_cmdimpl.c | 94 ++++++++++++++++++++-------------------------- > 2 files changed, 62 insertions(+), 57 deletions(-) > > diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1 > index c330016..ef0d763 100644 > --- a/docs/man/xl.pod.1 > +++ b/docs/man/xl.pod.1 > @@ -1147,13 +1147,30 @@ This is possible only if no domain is active in the cpu-pool. > > Renames a cpu-pool to I. > > -=item B I I > +=item B I I > > -Adds a cpu or all cpus of a numa node to a cpu-pool. > +Adds I or full NUMA I to I. pCPUs and NUMA nodes ^^^^ You can also specify some cpus inside a NUMA node. > +can be specified as single pCPU/node IDs or as ranges. > > -=item B I > +For example: > + > + (a) xl cpupool-cpu-add mypool 4 > + (b) xl cpupool-cpu-add mypool 1,5,10-16,^13 > + (c) xl cpupool-cpu-add mypool node:0,nodes:2-3,^10-12,8 > + > +means adding pCPU 4 to mypool, in (a); adding pCPUs 1,5,10,11,12,14,15 > +and 16, in (b); and adding all the pCPUs of NUMA nodes 0, 2 and 3, > +plus pCPU 8, but keeping out pCPUs 10,11,12, in (c). > + > +All the specified pCPUs that can be added to the cpupool will be added > +to it. If some pCPU can't (e.g., because they're already part of another > +cpupool), an error is reported about each one of them. > + > +=item B I > > -Removes a cpu or all cpus of a numa node from a cpu-pool. > +Removes I or full NUMA I from I. pCPUs and NUMA Ditto. > +nodes can be specified as single pCPU/node IDs or as ranges, using the > +exact same syntax as in B above. > > =item B I I > The changes look good to me. Wei.