From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: Questions about the use of idle_vcpu[] Date: Mon, 18 Jan 2016 12:00:00 +0100 Message-ID: <1453114800.11427.78.camel@citrix.com> References: <569845B7.2060207@seas.upenn.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7103441504554131655==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap , Tianyang Chen Cc: Meng Xu , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============7103441504554131655== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-WEm4+rbRPRAww867wXct" --=-WEm4+rbRPRAww867wXct Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2016-01-18 at 10:47 +0000, George Dunlap wrote: > On Fri, Jan 15, 2016 at 1:04 AM, Tianyang Chen >=20 > > If an idle vcpu is picked, the ret.time is set accordingly in both > > credit > > and credit2 by checking whether snext is idle. if so, credit > > returns -1 and > > credit2 returns 2ms. However, there is no corresponding code in the > > RTDS > > scheduler to handle this. When an idle_vcpu is picked, the value of > > ret.time > > would be 0 and the scheduler would be invoked again. What is the > > logic > > behind this? >=20 > No real logic, as far as I can tell. :-)=C2=A0=C2=A0The ret.time return v= alue > tells the generic scheduling code when to set the next scheduler > timer.=C2=A0=C2=A0According to the comment in xen/common/schedule.c:sched= ule(), > returning a negative value means "don't bother setting a timer" > (e.g., > no time limit).=C2=A0=C2=A0So credit1 does the right thing. >=20 It does. > It looks like credit2's behavior will probably prevent the processor > from going into deeper power-saving states, and rtds' behavior might > cause it to essentially busy-wait. >=20 RTDS behavior is broken in many respect, including this, and in fact, Meng and=C2=A0Tianyang are sending patches already to fix it (I'll let you guys have my comments shortly :-P). Credit2, AFAICR, could also avoid _always_ re-setting the timer, but it does need to do that at least a few times, even when idle is selected, because of the dynamic load tracking mechanism it includes. In fact, that is based on a 'decaying average', which in turns relies on csched2_schedule() to run and update the statistics, even when the cpu is idle. If we don't do that, the load tracking mechanism will never see that the cpu (well, it's actually the runqueue) is idle, and the load will never go down! :-/ I've got patches for: =C2=A0- extending the dynamic load tracking logic to all scheduler (iff =C2=A0 =C2=A0they want to use it, of course) =C2=A0- only call {csched,csched2,rtds}_schedule() if necessary. That =C2=A0 =C2=A0means, if the pcpu/runqueue is idle (and if the dynamic tracki= ng is =C2=A0 =C2=A0in use by the specific scheduler), only return a positive valu= e=C2=A0 =C2=A0 =C2=A0and set the timer if the dynamic load is >0, to allow it to de= cay =C2=A0 =C2=A0(if the pcpu/runqueue stays idle enough). But they are on hold, while I'm finishing some other work. > Dario / Meng, am I reading things right?=C2=A0=C2=A0If so, we should prob= ably > fix that... >=20 Yep, and in fact, we're on it already. I hope to be able to post my patches soon. :-) Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-WEm4+rbRPRAww867wXct 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 iEYEABECAAYFAlacxbAACgkQk4XaBE3IOsQk9ACgojXlUE/F0WSdPDbj2LcN9mah KDUAnjNLcl1z7XILA1C3so9UREea60HO =l122 -----END PGP SIGNATURE----- --=-WEm4+rbRPRAww867wXct-- --===============7103441504554131655== 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 --===============7103441504554131655==--