From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v7]xen: sched: convert RTDS from time to event driven model Date: Fri, 11 Mar 2016 00:53:06 +0100 Message-ID: <1457653986.3102.530.camel@citrix.com> References: <1457141967-3340-1-git-send-email-tiche@seas.upenn.edu> <1457538364.3102.418.camel@citrix.com> <1457606291.3102.473.camel@citrix.com> <1457628198.3102.525.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4199956596601250066==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aeAOJ-0004eI-2q for xen-devel@lists.xenproject.org; Thu, 10 Mar 2016 23:53:15 +0000 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: "xen-devel@lists.xenproject.org" , Tianyang Chen , George Dunlap , Dagaen Golomb List-Id: xen-devel@lists.xenproject.org --===============4199956596601250066== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ogG0Di/gSu4oWBPHYKco" --=-ogG0Di/gSu4oWBPHYKco Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-03-10 at 13:08 -0500, Meng Xu wrote: > On Thu, Mar 10, 2016 at 11:43 AM, Dario Faggioli > wrote: > >=C2=A0 > I think the pseudo-code makes sense. I just need to add some more > logic into it to make it complete. It forgets to handle the runq. >=20 You mean... > >=20 > >=20 > > =C2=A0 ... > > =C2=A0 LIST_HEAD(tmp_replq); > >=20 > > =C2=A0 list_for_each_safe(iter, tmp, replq) > > =C2=A0 { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0svc =3D replq_elem(iter); > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if ( now < svc->cur_deadline ) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0break; > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0list_del(&svc->replq_elem); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rt_update_deadline(now, svc); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0list_add(&svc->replq_elem, &tmp_rep= lq); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* if svc is on run= q, we need to put it to the correct place > since its deadline changes. */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if( __vcpu_on= _q(svc) ) > =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=A0= =C2=A0=C2=A0/* put back to runq */ > =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__q_remove(svc); > =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__runq_insert(ops, svc); >=20 ...This? Well, sure, this was being done in=C2=A0repl_handler() in Tianyang's v7 already, and I never meant to say we shouldn't do that any longer. I actually did not include it in here, because it was obvious to me that it still was necessary, and it was probably ok to put it in either of the loops (while I wanted to highlight what we need to do in the first and what in the second). > > It may look a bit convoluted, all these list moving, but I do like > > the > > fact that is is super self-contained. > >=20 > > How does that sound / What did I forget this time ? :-) > Besides we need to "resort" the runq if the to-be-replenished vcpu is > on the runq now. Besides that, I think it's good. >=20 If by re-sorting you mean what you added above, sure thing. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-ogG0Di/gSu4oWBPHYKco 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 iEYEABECAAYFAlbiCOIACgkQk4XaBE3IOsRDpQCglePiuYtLsQhtPGniwLm8jBr1 tVIAnj5pY+gU2vRUJxu8vAPJ0FEv6uFX =5tjp -----END PGP SIGNATURE----- --=-ogG0Di/gSu4oWBPHYKco-- --===============4199956596601250066== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============4199956596601250066==--