From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2 3/5] xl: enable per-VCPU extratime flag for RTDS Date: Mon, 09 Oct 2017 19:19:55 +0200 Message-ID: <1507569595.14690.128.camel@linux.it> References: <1504281532-3766-1-git-send-email-mengxu@cis.upenn.edu> <1504281532-3766-4-git-send-email-mengxu@cis.upenn.edu> <1505350270.13935.6.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9199783157015922837==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Meng Xu Cc: George Dunlap , Ian Jackson , Wei Liu , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============9199783157015922837== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-muRx7vcO5mxDwLkSzhiX" --=-muRx7vcO5mxDwLkSzhiX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2017-10-09 at 12:13 -0400, Meng Xu wrote: > On Wed, Sep 13, 2017 at 8:51 PM, Dario Faggioli > wrote: > >=20 > > On Fri, 2017-09-01 at 11:58 -0400, Meng Xu wrote: > > > diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c > > > index ba0159d..1b03d44 100644 > > > --- a/tools/xl/xl_cmdtable.c > > > +++ b/tools/xl/xl_cmdtable.c > > > @@ -272,12 +272,13 @@ struct cmd_spec cmd_table[] =3D { > > > { "sched-rtds", > > > &main_sched_rtds, 0, 1, > > > "Get/set rtds scheduler parameters", > > > - "[-d [-v[=3DVCPUID/all]] [-p[=3DPERIOD]] [- > > > b[=3DBUDGET]]]", > > > + "[-d [-v[=3DVCPUID/all]] [-p[=3DPERIOD]] [- > > > b[=3DBUDGET]] [- > > > e[=3DEXTRATIME]]]", > > > "-d DOMAIN, --domain=3DDOMAIN Domain to modify\n" > > > "-v VCPUID/all, --vcpuid=3DVCPUID/all VCPU to modify or > > > output;\n" > > > " Using '-v all' to modify/output all > > > vcpus\n" > > > "-p PERIOD, --period=3DPERIOD Period (us)\n" > > > "-b BUDGET, --budget=3DBUDGET Budget (us)\n" > > > + "-e EXTRATIME, --extratime=3DEXTRATIME EXTRATIME (1=3Dyes, > > > 0=3Dno)\n" > >=20 > > Extratime > > ? >=20 > We need to provide the option to configure the extratime flag for > each > vcpu, right? >=20 What I meant is that, that particular word, it should be written 'Extratime' and not 'EXTRATIME'. > > xl sched-rtds >=20 > Cpupool Pool-0: sched=3DRTDS > Name ID Period Budget Extra time > Domain-0 0 10000 4000 yes >=20 Ok (the others as well). I'd use 'Extratime' (no space in between the two words), but that's not really a big deal > > > @@ -860,6 +878,7 @@ int main_sched_rtds(int argc, char **argv) > > > xmalloc(sizeof(libxl_sched_params > > > )); > > > scinfo.vcpus[0].period =3D periods[0]; > > > scinfo.vcpus[0].budget =3D budgets[0]; > > > + scinfo.vcpus[0].extratime =3D extratimes[0] ? 1 : > > > 0; > > >=20 > >=20 > > But does these two hunks mean that if I pass `-e 10`, that is > > considered a legal way to enable extratime? Shouldn't we enforce > > (either here in xl or in libxl) the value to be 0 or 1 ? >=20 > Yes, we should enforce the extratime to 0 or 1. How about checking > the > value of extratime when we parse each extratime value? > The change of the code will be like the following in xl_sched.c: >=20 > 757 case 'e': > 758 if (e_index >=3D e_size) { /* extratime array is full */ > 759 e_size *=3D 2; > 760 extratimes =3D xrealloc(extratimes, e_size); > 761 } > 762 extratimes[e_index++] =3D strtol(optarg, NULL, 10); > 763 if ( extratimes[e_index-1] !=3D 0 && extratimes[e_index-1] > !=3D 1) > 764 { > 765 fprintf(stderr, "Invalid extratime.\n"); > 766 r =3D EXIT_FAILURE; > 767 goto out; > 768 } > 769 opt_e =3D 1; > 770 break; >=20 > What do you think? >=20 Err, yes, this looks fine to me. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli --=-muRx7vcO5mxDwLkSzhiX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEES5ssOj3Vhr0WPnOLFkJ4iaW4c+4FAlnbr7sACgkQFkJ4iaW4 c+7yNRAAtZfdHMlC7ekKfZDfNROqlre/Qiol/G5VRXtTC9Gp/yfBqkaYWt4RrZQT apv1hOhzDTdAu0gD4ALHgTX1YMDyhGzA45hLt73lqvrPiNgCnmn0zXwUcKrMpVcq RM4kEK1j1Ybgyb4tnScReffOm2yaze9fHSJTKVi2S6eqNKsic2orMCw6hzJJzUjA yUMq3dg9C2OBGAqRV79rq6qD7CZpdvpjKXZwnBmsmplXIK0m7XItvUTC8JnLu6n3 NhrKcBA1i/Z6ZXkGbttnT/nza/FFekGtYholnadkE4csAAaOu3hJQJVE7hErxC4P /y/SQV8e1wUU6a5lIBYyCxsCPPuJlpxJcJZf/TL8yvRVgaB8pJPiPbIn1q4NtIQX 80Eiif6jAAF3kWSX0+9MCkervG/BmBnzGAscaVcyDPrD/N6tIhIqtjrjfztKEhpW B0wWAMr83ByxLtCJ9SLjGR554F75XqZktHaAe+nMuC14MuGPDBLoq4oV8/egcmbZ bJxjI7TiPFfny7RXSrcbpBUHdSk3vyGUexHBfII6Hc+hMchO3ECMOtQ1Fk2hrb4H Go4dl41LT1EKz9U8xwkJoZ2UbSs2PB0BhnW8sT5X+C22VzkDDH+W02+KatMvPcmc 8xzvNXc/8v4TQbnYe0BkOo1mF3yK9P934cJxz4N5zrvUNErjdsA= =Ha60 -----END PGP SIGNATURE----- --=-muRx7vcO5mxDwLkSzhiX-- --===============9199783157015922837== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============9199783157015922837==--