From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v4] xen: sched: convert RTDS from time to event driven model Date: Mon, 8 Feb 2016 22:23:10 +0100 Message-ID: <1454966590.9227.597.camel@citrix.com> References: <1454301176-7131-1-git-send-email-tiche@seas.upenn.edu> <1454425705.9227.176.camel@citrix.com> <56B0F0E7.3070604@seas.upenn.edu> <1454503184.9227.276.camel@citrix.com> <56B2B628.2020604@seas.upenn.edu> <1454683182.9227.431.camel@citrix.com> <56B5764C.7090504@seas.upenn.edu> <1454930829.9227.555.camel@citrix.com> <56B8E6AA.1000000@seas.upenn.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8007544907717934595==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aStHC-00046f-1g for xen-devel@lists.xenproject.org; Mon, 08 Feb 2016 21:23:18 +0000 In-Reply-To: <56B8E6AA.1000000@seas.upenn.edu> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tianyang Chen , xen-devel@lists.xenproject.org Cc: george.dunlap@citrix.com, Dagaen Golomb , Meng Xu List-Id: xen-devel@lists.xenproject.org --===============8007544907717934595== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-giMDHEeqdyL0hcDseegp" --=-giMDHEeqdyL0hcDseegp Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2016-02-08 at 14:04 -0500, Tianyang Chen wrote: >=20 > On 2/8/2016 6:27 AM, Dario Faggioli wrote: > >=C2=A0 > > I don't really follow, but I have the feeling that you're making it > > sound more complicated like it is in reality... :-) > >=20 >=20 > So my reasoning is that, when sleep() is called in sched_rt.c, a > vcpu=C2=A0 > will need to be taken off from the replenishment event queue. > However, a=C2=A0 > vcpu can be put to sleep/not-runnable without even calling sleep(),=C2=A0 > Well, sure... for instance, it can block. > which corresponds to a later "spurious wakeup". Is there any way > that=C2=A0 > RTDS can know when this happens?=20 > There is no way no one can tell what will happen in future but, luckily, we don't need to care! There is no such thing as the correspondence between spurious wakeups and sleeps. > If not, in rt_vcpu_wake(), it needs to=C2=A0 > check, in all situations, if a vcpu is on the replenishment event > queue=C2=A0 > or not. If not, add it back. I'm I right? >=20 > vcpu running=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0--> sleep(), taken off fr= om replq=09 > vcpu on queue=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0--> sleep(), taken off from re= plq > vcpu not on queue --> sleep(), taken off from replq >=20 No. What happens is, more or less, like this: =C2=A0- sleep =C2=A0: take off from runq, take off from replq =C2=A0- wakeup : put back in runq, put back in replq =C2=A0- wakeup : already on runq, already on replq =3D=3D> nothing! =C2=A0... =C2=A0[becomes running] =C2=A0... =C2=A0- wakeup : on a cpu, already on replq =3D=3D> nothing! > However, >=20 > vcpu running/on queque/not on queue --> just not runnable anymore > (still=C2=A0 > on replq) --> spurious wakeup (still on replq) >=20 > vcpus shouldn't be added back to replq again. >=20 Exactly, and in fact, you do nothing. :-) > So in all cases, rt_vcpu_wake() always need to check if a vcpu is on > the=C2=A0 > replq or not. >=20 Eheh... looks like we agree on the fact that we disagree. :-) > Now I think because of the addition of a replenishment queue, > spurious=C2=A0 > wake up cannot be simply treated as NOP. Just like V4, the "Out" > label=C2=A0 > basically maintains the replenishment queue. >=20 I do think so. I also think that we may need to think about the blocking case (i.e., whether to do something for removing the vcpu from the replenishment queue or not). But really... > Anyways, I agree it's gonna be easier to reason on v5 where all > changes=C2=A0 > are applied. >=20 ... let's do this! :-) Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-giMDHEeqdyL0hcDseegp 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 iEYEABECAAYFAla5Bz8ACgkQk4XaBE3IOsRJugCgrQW2XPNWyTd7UDdmRlii1VBS k3QAoKjiOfUTDqeUZ1VklyeGtp67fpw9 =oo8W -----END PGP SIGNATURE----- --=-giMDHEeqdyL0hcDseegp-- --===============8007544907717934595== 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 --===============8007544907717934595==--