From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH RFC v1 3/3] xl: enable per-VCPU work conserving flag for RTDS Date: Thu, 3 Aug 2017 18:03:38 +0200 Message-ID: <1501776218.28477.12.camel@citrix.com> References: <1501612434-5803-1-git-send-email-mengxu@cis.upenn.edu> <1501612434-5803-4-git-send-email-mengxu@cis.upenn.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2040055584292678836==" Return-path: Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddIbl-0004nt-TS for xen-devel@lists.xenproject.org; Thu, 03 Aug 2017 16:04:22 +0000 In-Reply-To: <1501612434-5803-4-git-send-email-mengxu@cis.upenn.edu> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Meng Xu , xen-devel@lists.xenproject.org Cc: george.dunlap@eu.citrix.com, wei.liu2@citrix.com, xumengpanda@gmail.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org --===============2040055584292678836== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-yIG3k7doxArJ1xawr2d5" --=-yIG3k7doxArJ1xawr2d5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2017-08-01 at 14:33 -0400, Meng Xu wrote: > --- a/tools/xl/xl_cmdtable.c > +++ b/tools/xl/xl_cmdtable.c > @@ -272,12 +272,13 @@ struct cmd_spec cmd_table[] =3D { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0{ "sched-rtds", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0&main_sched_rtds, 0, 1, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"Get/set rtds scheduler paramet= ers", > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"[-d [-v[=3DVCPUID/all]] [-= p[=3DPERIOD]] [-b[=3DBUDGET]]]", > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"[-d [-v[=3DVCPUID/all]] [-= p[=3DPERIOD]] [-b[=3DBUDGET]]] > [-w[=3DWORKCONSERVING]]", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"-d DOMAIN, --domain=3DDOMAIN= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Domain to modify\n" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"-v VCPUID/all, --vcpuid=3DVCPU= ID/all=C2=A0=C2=A0=C2=A0=C2=A0VCPU to modify or > output;\n" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Using '-v all' = to modify/output all vcpus\n" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"-p PERIOD, --period=3DPERIOD= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Period (us)\n" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"-b BUDGET, --budget=3DBUDGET= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Budget (us)\n" > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"-w WORKCONSERVING, -- > workconserving=3DWORKCONSERVING=C2=A0=C2=A0=C2=A0=C2=A0WORKCONSERVING (1= =3Dyes,0=3Dno)\n" > Does this really need to accept a 1 or 0 parameter? Can't it be that, if -w is provided, the vCPU is marked as work-conserving, if it's not, it's considered reservation only. > --- a/tools/xl/xl_sched.c > +++ b/tools/xl/xl_sched.c >=20 > @@ -279,8 +280,8 @@ static int sched_rtds_vcpu_output(int domid, > libxl_vcpu_sched_params *scinfo) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int i; > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (domid < 0) { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0printf("%-33s %4s %4s %9= s %9s\n", "Name", "ID", > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0"VCPU", "Period", "Budget"); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0printf("%-33s %4s %4s %9= s %9s %15s\n", "Name", "ID", > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0"VCPU", "Period", "Budget", "Work conserving"); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 0; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > =C2=A0 > @@ -290,12 +291,13 @@ static int sched_rtds_vcpu_output(int domid, > libxl_vcpu_sched_params *scinfo) > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0domname =3D libxl_domid_to_name(ctx, domid)= ; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0for ( i =3D 0; i < scinfo->num_vcpus; i++ )= { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0printf("%-33s %4d %4d %9= "PRIu32" %9"PRIu32"\n", > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0printf("%-33s %4d %4d %9= "PRIu32" %9"PRIu32" %15d\n", > As far as printing it goes, OTOH, I would indeed print a string, i.e., "yes", if the field is found to be 1 (true), or "no", if the field is found to be 0 (false). > @@ -702,14 +705,18 @@ int main_sched_rtds(int argc, char **argv) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int *vcpus =3D (int *)xmalloc(sizeof(int));= /* IDs of VCPUs that > change */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int *periods =3D (int *)xmalloc(sizeof(int)= ); /* period is in > microsecond */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int *budgets =3D (int *)xmalloc(sizeof(int)= ); /* budget is in > microsecond */ > +=C2=A0=C2=A0=C2=A0=C2=A0int *workconservings =3D (int *)xmalloc(sizeof(i= nt)); /* budget is > in microsecond */ > Yeah, budget is in microseconds. But this is not budget! :-P In fact (jokes apart), it can be just a bool, can't it? Regadrs, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-yIG3k7doxArJ1xawr2d5 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 iQIcBAABCAAGBQJZg0laAAoJEBZCeImluHPu/YsQAMpVe+GJpIrFSC13YCG19W6c k1nGqY1Q6XLyurSfEylghOZYRxXLGBpPnFrHRKe9i10McDArstCaOSJr24g21Wgk 9B20vkoZKTifA2qdMoOov1w6Xa0n0OohR8uh0HHLv0LIWWmseKOE9XoyM/TsHO19 GC0yoVHgAVpNcEWKTXM4DQLS1UJhs3DAXr8Dmk+qgcqyDF4bqkyVXWfpNtoRDHSP P0l2FsIT0ofhH9u17WWT0ypFfCFOXHs21kvcZMAauE2SJsG6d7KpG0OsoGzeBHyX nqY+g0pacMJNDSDPuXkLOYTefQrXiMZLKFrQY4N3pIbVG0mtF+/kxnqg69Emsi/m +vwsA8UA2ERXIwGvi1XdleIOEFTBdtz7wKoe/GDtzVxT8ou+5wYCwP1AKrsWBiwA mDXN48QZKd7ftiihVtaWl5hlp1DSF6b1tBOhpDsHNc6B4g4xv82RsOB0cwdQdgEo 81Dw08bbFuV5SY4q/NfT1z462f61YbMUXvFqtzkfpOWJ16OWwZx+UEhgNMO4zgVC 8wC4znLOoGgkY07oFtJcCUJm7q9nWnbHlmzCSx2/LfOlElCH5HvbUx/tr4vWth+m 4hdhA9FMGaFpaU78ksO8f0f9xcEZLWC6JsviHHyPFKRgcgKdHE9/gIJ1agiS+MxH SpOHlAmVeWX3LCyNdm5H =5FMj -----END PGP SIGNATURE----- --=-yIG3k7doxArJ1xawr2d5-- --===============2040055584292678836== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============2040055584292678836==--