From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v6 for Xen 4.7 1/4] xen: enable per-VCPU parameter settings for RTDS scheduler Date: Wed, 16 Mar 2016 09:23:17 +0100 Message-ID: <1458116597.3102.773.camel@citrix.com> References: <1457286958-5427-1-git-send-email-lichong659@gmail.com> <1457286958-5427-2-git-send-email-lichong659@gmail.com> <20160308190950.GT31271@citrix.com> <1457539804.3102.425.camel@citrix.com> <56E05F8F02000078000DAF15@prv-mh.provo.novell.com> <56E6866202000078000DBECD@prv-mh.provo.novell.com> <1457946623.3102.636.camel@citrix.com> <56E68F5202000078000DBF46@prv-mh.provo.novell.com> <1457949930.3102.641.camel@citrix.com> <1458060092.3102.721.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2813439750212620284==" 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 , Chong Li Cc: Chong Li , Wei Liu , Sisu Xi , GeorgeDunlap , xen-devel , Jan Beulich , Dagaen Golomb List-Id: xen-devel@lists.xenproject.org --===============2813439750212620284== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Auz23EBcSYHRrzUISqWM" --=-Auz23EBcSYHRrzUISqWM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2016-03-15 at 23:43 -0400, Meng Xu wrote: > On Tue, Mar 15, 2016 at 11:32 PM, Chong Li > wrote: > > > > How about: > > > >=20 > > > > We create a global variable in sched_rt.c: > > > > =C2=A0=C2=A0=C2=A0=C2=A0/* This variable holds its value through hy= erpcall re- > > > > issueing. > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* When finding vcpu settings with too= low budget or period > > > > (e.g, > > > > 100 us), we print a warning > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* and set this variable "true". No mo= re warnings are > > > > printed > > > > until this variable > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* becomes false. > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*/ > > > > =C2=A0=C2=A0=C2=A0=C2=A0static bool warned; > > > > Initialize it as "false" in rt_init(). > > > > In your example, > > > > we "warned =3D true" when we find the first vcpu has budget less > > > > than > > > > 100 us. Outside > > > > of the while loop, we do: > > > > =C2=A0=C2=A0=C2=A0=C2=A0if ( index =3D=3D op->u.v.nr_vcpus ) /* no = more hypercall re- > > > > issueing */ > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0warned =3D false; > > > >=20 > > >=C2=A0 > > >=C2=A0 > > If we define > >=20 > > =C2=A0=C2=A0=C2=A0static bool warned; > >=20 > > at the beginning of rt_dom_cntl(), do we need to initialize it? If > > without > > initialization, I think its default value is "false", which is just > > what we need. > >=20 > We need initializing any variable we are going to use, of course. We > should not reply on the compiler to give an initialized value. :-) > We need to initialize any variable that would be used uninitialized, if we don't initialize it. :-) However, something along the line of a static variable was also what I was thinking to, but I don't think it works sufficiently well for justifying it being introduced. And making things work well is proving to be too hard to keep bothering. Reasons why I'm saying I don't think it works well are that: (a) there may be more than one CPU executing this hypercall, and they'd race on the value of the static flag; (b) what if the hypercall finishes processing the first lot of 64 vCPUs with the flag set to false, are we sure it can't be anything than "still false", when the new hypercal, for the next lot of vCPUs of the same domain, is re-issued? I continue to think that it could be useful to have this logged, but I'm leaning toward just killing it for now (and maybe finding another way to check and warn about the same thing or one of the effects it produces, later). Meng, what do you think? >=20 > Meng --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-Auz23EBcSYHRrzUISqWM 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 iEYEABECAAYFAlbpF/wACgkQk4XaBE3IOsQKowCffzQpQlwGn2urRvV2L0t7eQiX CBkAn0UQJHXNMqODF8MHTiRGnkpcRmE+ =Aqww -----END PGP SIGNATURE----- --=-Auz23EBcSYHRrzUISqWM-- --===============2813439750212620284== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============2813439750212620284==--