From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 7/9] xl: enable using ranges of pCPUs when creating cpupools Date: Mon, 9 Mar 2015 11:18:57 +0000 Message-ID: <1425899935.2729.22.camel@citrix.com> References: <20150306170758.7269.53821.stgit@Solace.station> <20150306172150.7269.86101.stgit@Solace.station> <20150309105813.GJ18491@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1170397999178022095==" Return-path: In-Reply-To: <20150309105813.GJ18491@zion.uk.xensource.com> Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: "JGross@suse.com" , Ian Jackson , Stefano Stabellini , Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============1170397999178022095== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-VqkTmJ7aBHryMG31adAt" --=-VqkTmJ7aBHryMG31adAt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2015-03-09 at 10:58 +0000, Wei Liu wrote: > On Fri, Mar 06, 2015 at 06:21:51PM +0100, Dario Faggioli wrote: > > --- > > docs/man/xlcpupool.cfg.pod.5 | 22 +++++++++++++++++++--- > > tools/libxl/xl_cmdimpl.c | 17 ++++++++++++++--- > > 2 files changed, 33 insertions(+), 6 deletions(-) > >=20 > > diff --git a/docs/man/xlcpupool.cfg.pod.5 b/docs/man/xlcpupool.cfg.pod.= 5 > > index bb15cbe..2ff8ee8 100644 > > --- a/docs/man/xlcpupool.cfg.pod.5 > > +++ b/docs/man/xlcpupool.cfg.pod.5 > > @@ -93,10 +93,26 @@ Specifies the cpus of the NUMA-nodes given in C (an integer or > > a list of integers) to be member of the cpupool. The free cpus in the > > specified nodes are allocated in the new cpupool. > > =20 > > -=3Ditem B > > +=3Ditem B > > =20 > > -The specified C are allocated in the new cpupool. All cpus must > > -be free. Must not be specified together with B. > > +Specifies the cpus that will be member of the cpupool. All the specifi= ed > > +cpus must be free, or creation will fail. C may be specified > > +as follows: > > + > > +=3Dover 4 > > + > > +=3Ditem ["2", "3", "5"] > > + > > +means that cpus 2,3,5 will be member of the cpupool. > > + >=20 > I suppose this is the old syntax? >=20 It is. > I'm asking because I want to be sure we still support the old syntax. I > think we still support the old syntax from the look of the changes below > but I'd better get confirmation from you. >=20 I also think we should, and, in fact, we do. :-) > > +=3Ditem "0-3,5,^1" > > + > > +means that cpus 0,2,3 and 5 will be member of the cpupool. A "node:" o= r > > +"nodes:" modifier can be used. E.g., "0,node:1,nodes:2-3,^10-13" means > > +that pcpus 0, plus all the cpus of NUMA nodes 1,2,3 with the exception > > +of cpus 10,11,12,13 will be memeber of the cpupool. > > + > > +=3Dback > > =20 > > If neither B nor B are specified only the first free cpu > > found will be allocated in the new cpupool. > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > > index c748ba0..e6d1234 100644 > > --- a/tools/libxl/xl_cmdimpl.c > > +++ b/tools/libxl/xl_cmdimpl.c > > @@ -7163,18 +7163,29 @@ int main_cpupoolcreate(int argc, char **argv) > > fprintf(stderr, "no free cpu found\n"); > > goto out_cfg; > > } > > - } else if (!xlu_cfg_get_list(config, "cpus", &cpus, 0, 0)) { > > + } else if (!xlu_cfg_get_list(config, "cpus", &cpus, 0, 1)) { > > n_cpus =3D 0; > > while ((buf =3D xlu_cfg_get_listitem(cpus, n_cpus)) !=3D NULL)= { > > i =3D atoi(buf); > > - if ((i < 0) || (i >=3D freemap.size * 8) || > > - !libxl_bitmap_test(&freemap, i)) { > > + if ((i < 0) || !libxl_bitmap_test(&freemap, i)) { > > fprintf(stderr, "cpu %d illegal or not free\n", i); > > goto out_cfg; > > } > > libxl_bitmap_set(&cpumap, i); > > n_cpus++; > > } > > + } else if (!xlu_cfg_get_string(config, "cpus", &buf, 0)) { > > + if (cpurange_parse(buf, &cpumap)) >=20 > Perhaps print something to say the cpu range specified is invalid? >=20 It happens already inside cpurange_parse() (well, to be precise, it's inside update_cpumap_range() ), which is in a better position for printing the most meaningful error messages. If you check any other call site of cpurange_parse(), none prints anything on failure, exactly for that reason. Regards, Dario --=-VqkTmJ7aBHryMG31adAt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlT9gZ8ACgkQk4XaBE3IOsT5kwCgg1N2tkvYgw4G107QuFB1eGlK V+sAnin+SLBKEcPkFUbyETFcVX4IBN50 =EXEd -----END PGP SIGNATURE----- --=-VqkTmJ7aBHryMG31adAt-- --===============1170397999178022095== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============1170397999178022095==--