From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 1 of 3] Support of getting scheduler defaults Date: Wed, 23 May 2012 01:46:41 +0200 Message-ID: <1337730401.27368.38.camel@Solace> References: <56c50b3f6cc3eb1de8b8.1337678212@nehalem1> <1337689344.10118.92.camel@zakaz.uk.xensource.com> <4FBB86AE.7010908@ts.fujitsu.com> <1337689975.10118.102.camel@zakaz.uk.xensource.com> <4FBB8D92.8050800@ts.fujitsu.com> <1337694056.10118.128.camel@zakaz.uk.xensource.com> <1337698766.10118.139.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0685880598014559691==" Return-path: In-Reply-To: <1337698766.10118.139.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: George Dunlap , "xen-devel@lists.xensource.com" , Juergen Gross List-Id: xen-devel@lists.xenproject.org --===============0685880598014559691== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-HSOP1a7PXHHZGrRc+SJy" --=-HSOP1a7PXHHZGrRc+SJy Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2012-05-22 at 15:59 +0100, Ian Campbell wrote: > Like the below. Lightly tested with the credit scheduler. >=20 > I think CAP is the only one for which 0 is a real valid value, but I'm > not sure (especially with the SEDF ones which didn't have existing > limits checks in the set function I could crib from...). >=20 Yep, that's because they're mostly time values. xen/common/sched_sedf.c hosts some ranges for some of them, but I'm not sure we want to propagate those: #define PERIOD_MAX MILLISECS(10000) /* 10s */ #define PERIOD_MIN (MICROSECS(10)) /* 10us */ #define SLICE_MIN (MICROSECS(5)) /* 5us */ Also, extratime is a flag, so I think 0 and 1 are both meaningful values, maybe we can go for -1 as for cap (I'll try and let you know). > I'm pretty sure that libxl__sched_set_params needs to get the correct > scheduler for the particular domain, but I've no idea how to get that... >=20 Again, I was thinking something like what Juergen did here could help (go getting the scheduler of the cpupool the domain belongs to)... O am I misunderstanding the issue? + poolinfo =3D libxl_list_cpupool(ctx, &n_pools); + if (!poolinfo) + return ERROR_NOMEM; + + ret =3D ERROR_INVAL; + for (p =3D 0; p < n_pools; p++) { + if (poolinfo[p].poolid =3D=3D poolid) { + scparams->sched =3D poolinfo[p].sched; + ret =3D 0; + } + libxl_cpupoolinfo_dispose(poolinfo + p); + } + > 8<--------------------------- >=20 > # HG changeset patch > # User Ian Campbell > # Date 1337698727 -3600 > # Node ID 355030f95eb313605a0e43aa7328e731b28a28b3 > # Parent 426bbf58cea4559464b6e5d3ff0f65324a5f5926 > libxl: make it possible to explicitly specify default sched params >=20 > To do so we define a descriminating value which is never a valid real val= ue for > each parameter. >=20 > While there: >=20 > - remove tslice_ms and ratelimit_us from libxl_sched_params and from the= xl > domain config parser. These are global scheduler properties, not per-d= omain > ones (and were never read in any case). > - removed libxl_sched_*_domain in favour of libxl_sched_params. > - rename libxl_sched_params to libxl_sched_domain_params for clarity. > - use this new functionality for the various xl commands which set sched > parameters, which saves an explicit read-modify-write in xl. > - removed call of xc_domain_getinfolist from a few functions which weren= 't > actually using the result (looks like a cut and paste error) > - fix xl which was setting period for a variety of different config keys= . >=20 > Signed-off-by: Ian Campbell >=20 > diff -r 426bbf58cea4 -r 355030f95eb3 tools/libxl/libxl.c > --- a/tools/libxl/libxl.c Tue May 22 14:19:07 2012 +0100 > +++ b/tools/libxl/libxl.c Tue May 22 15:58:47 2012 +0100 > @@ -3168,19 +3168,19 @@ libxl_scheduler libxl_get_scheduler(libx > } > > =20 > int libxl_sched_sedf_domain_set(libxl_ctx *ctx, uint32_t domid, > - libxl_sched_sedf_domain *scinfo) > + libxl_sched_domain_params *scinfo) > { > - xc_domaininfo_t domaininfo; > - int rc; > - > - rc =3D xc_domain_getinfolist(ctx->xch, domid, 1, &domaininfo); > - if (rc < 0) { > - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info lis= t"); > + uint64_t period; > + uint64_t slice; > + uint64_t latency; > + uint16_t extratime; > + uint16_t weight; > + > + int ret; > + > + ret =3D xc_sedf_domain_get(ctx->xch, domid, &period, &slice, &latenc= y, > + &extratime, &weight); > + if (ret !=3D 0) { > + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain sched se= df"); > return ERROR_FAIL; > } > - if (rc !=3D 1 || domaininfo.domain !=3D domid) > - return ERROR_INVAL; > - > - > - rc =3D xc_sedf_domain_set(ctx->xch, domid, scinfo->period * 1000000, > - scinfo->slice * 1000000, scinfo->latency * 1= 000000, > - scinfo->extratime, scinfo->weight); > - if ( rc < 0 ) { > + > + if (scinfo->period !=3D LIBXL_SCHED_DOMAIN_PARAM_PERIOD_DEFAULT) > + period =3D scinfo->period * 1000000; > + if (scinfo->slice !=3D LIBXL_SCHED_DOMAIN_PARAM_SLICE_DEFAULT) > + period =3D scinfo->slice * 1000000; > + if (scinfo->latency !=3D LIBXL_SCHED_DOMAIN_PARAM_LATENCY_DEFAULT) > + period =3D scinfo->latency * 1000000; > + if (scinfo->extratime !=3D LIBXL_SCHED_DOMAIN_PARAM_EXTRATIME_DEFAUL= T) > + period =3D scinfo->extratime; > + if (scinfo->weight !=3D LIBXL_SCHED_DOMAIN_PARAM_WEIGHT_DEFAULT) > + period =3D scinfo->weight; > + > + ret =3D xc_sedf_domain_set(ctx->xch, domid, period, slice, latency, > + extratime, weight); > + if ( ret < 0 ) { > LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting domain sched se= df"); > return ERROR_FAIL; > } > # xl create vm1.cfg Parsing config from vm1.cfg libxl: error: libxl.c:3417:libxl_sched_sedf_domain_set: setting domain sche= d sedf: Invalid argument And I'm getting the above independently on what I put in the config file (valid params, no params at all, etc.). I also can't change the scheduling parameters of a domain on-line anymore: # xl sched-sedf -d 3 -p 100 -s 50 libxl: error: libxl.c:3417:libxl_sched_sedf_domain_set: setting domain sche= d sedf: Invalid argument libxl_sched_sedf_domain_set failed. I'll try digging a bit more into this ASAP. On more thing, are we ok with the _set command failing and he domain being created anyway? Or perhaps the whole process should just abort? Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-HSOP1a7PXHHZGrRc+SJy 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 v1.4.12 (GNU/Linux) iEYEABECAAYFAk+8JWEACgkQk4XaBE3IOsSXsgCgpA8J2jC1URMF+CtBen+bR0ES 0YYAn0CQ5JRMP7W5Fv2we670x52VIBJw =igXG -----END PGP SIGNATURE----- --=-HSOP1a7PXHHZGrRc+SJy-- --===============0685880598014559691== 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 --===============0685880598014559691==--