From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 3 of 5 V2] libxl: make it possible to explicitly specify default sched params Date: Wed, 30 May 2012 09:26:33 +0200 Message-ID: <1338362793.2609.20.camel@Abyss> References: <274de8e1e0d116070d34.1338299821@cosworth.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6987873812209340453==" Return-path: In-Reply-To: <274de8e1e0d116070d34.1338299821@cosworth.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: Ian.Jackson@citrix.com, Juergen Gross , George.Dunlap@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============6987873812209340453== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-u8uKX1IDSSXyacn8aF15" --=-u8uKX1IDSSXyacn8aF15 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2012-05-29 at 14:57 +0100, Ian Campbell wrote:=20 > int libxl_sched_sedf_domain_set(libxl_ctx *ctx, uint32_t domid, > - libxl_sched_sedf_domain *scinfo) > + libxl_domain_sched_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_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT) > + period =3D scinfo->period * 1000000; > + if (scinfo->slice !=3D LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT) > + slice =3D scinfo->slice * 1000000; > + if (scinfo->latency !=3D LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT) > + latency =3D scinfo->latency * 1000000; > + if (scinfo->extratime !=3D LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAUL= T) > + extratime =3D scinfo->extratime; > + if (scinfo->weight !=3D LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT) > + weight =3D scinfo->weight; > + > + ret =3D xc_sedf_domain_set(ctx->xch, domid, period, slice, latency, > + extratime, weight); > I only tested this on your last version of this series (and I am still trying to find the time to test this new one) and this wasn't working. Reason should be the fact that the SEDF code in Xen wants you to put a domain either in the "proper-EDF" state _or_ in the "weighted-best-effort-state", and it discriminates this by checking whether you're passing a slice+period _or_ a weight. IOW, if your domain has a slice+period and wants a weight, either you set slice and period to zero, or the whole thing will fail. In fact, with this code, the new parameter set will include both the slice+period (as the domain has them set) and the new weight that is being set by the call... Does this sound right? That's why the current int main_sched_sedf(int argc, char **argv) is doing this: if (opt_p) { scinfo.period =3D period; scinfo.weight =3D 0; } if (opt_s) { scinfo.slice =3D slice; scinfo.weight =3D 0; } if (opt_l) scinfo.latency =3D latency; if (opt_e) scinfo.extratime =3D extra; if (opt_w) { scinfo.weight =3D weight; scinfo.period =3D 0; scinfo.slice =3D 0; }=20 That being said, I'm not sure at what level we want to enforce something like the above. The lowest level toolstack seems fine to me, which would mean putting something like the code above in the config file parsing... If you agree, I'll try that and let you know whether or not it works. 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) --=-u8uKX1IDSSXyacn8aF15 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/Fy6kACgkQk4XaBE3IOsQyMgCeKSsHCDEfNgl0GQ91/S9NDpH2 eqwAnRbumSEWPtS4Atzw/pRG5EvVB8Rl =Av7g -----END PGP SIGNATURE----- --=-u8uKX1IDSSXyacn8aF15-- --===============6987873812209340453== 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 --===============6987873812209340453==--