From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [RFC PATCH 1/4] Implement cbs algorithm, remove extra queues, latency scaling, and weight support from sedf Date: Sat, 28 Jun 2014 04:27:54 +0200 Message-ID: <1403922474.8515.134.camel@Solace> References: <1402689488-3577-1-git-send-email-josh.whitehead@dornerworks.com> <1402689488-3577-2-git-send-email-josh.whitehead@dornerworks.com> <1403021178.16864.190.camel@Solace> <53AC8018.4090402@dornerworks.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6843196212109751425==" Return-path: In-Reply-To: <53AC8018.4090402@dornerworks.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Joshua Whitehead Cc: Ian Campbell , Stefano Stabellini , George Dunlap , Ian Jackson , Robert VanVossen , Xen-devel , Nate Studer List-Id: xen-devel@lists.xenproject.org --===============6843196212109751425== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-MUwpCZUn6Dl4RJD6s3us" --=-MUwpCZUn6Dl4RJD6s3us Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On gio, 2014-06-26 at 16:18 -0400, Joshua Whitehead wrote: > On 6/17/2014 12:06 PM, Dario Faggioli wrote: > >> + > >> + /* Make up for the overage by pushing the deadline > >> + into the future */ > >> + inf->deadl_abs +=3D ((inf->cputime / inf->slice) > >> + * inf->period) * 2; > >> + inf->cputime -=3D (inf->cputime / inf->slice) * inf->slic= e; > >> + } > >> > > Can you enlighten me a bit about the math here? I see what you're up to= , > > but I'm not sure I understand the '*2'... > >=20 > Ah, the '*2' is not necessary, it may be a leftover from an experiment we= were > doing at one point. This was something we caught as well but apparently = it got > overlooked before we submitted the series. I will make sure to update th= is for > the V2 patch. >=20 Ok. When I'll see v2, I'll tell more, as I can't right now. My impression still is that what you're up to is sensible, but I think it should be done differently. At least, I've always done it differently, in all the EDF/CBS implementation I wrote, and I'm not sure I fully understand this variant of yours. But again, send v2, and I'll comment on it! :-) > > You can shuffle this a bit more, and avoid the '/'. > >=20 > > The condition above can be rewritten as: > >=20 > > c >=3D (d-r) * (inf->slide/inf->period) > >=20 > > i.e.: > >=20 > > c * inf->period >=3D (d-r) * inf->slice > >=20 > > and this, the code can be rewritten as: > >=20 > > if ((inf->slice - inf->cputime) * inf->period >=3D > > (inf->deadl_abs - now) * inf->slice) > >=20 > > which I think it's better. One may worry about the fact that the > > multiplication can overflow, but that's really unlikely, since all the > > involved time values are relative (i.e., remaining runtime, time to > > deadline, etc). > >=20 > > Anyway, let's cross that bridge when we get to it. > > > This is a good point- because of the new nature of the scheduler we had n= ot made > any attempts at simplification yet, but rather attempted to keep it as ap= parent > and straightforward as possible until we were positive everything was wor= king > correctly. This would certainly be a good simplification and I agree the > multiplication overflow is highly unlikely. If you would like I can make= this > update in the V2, or we can leave it until we get any other bugs ironed o= ut, > whichever you think would be easiest. > It's rather basic math, IMO, and it does not really makes the condition, and hence the whole algorithm, any harder to understand. I'd say, do it right away, in v2. Do put a comment on top, with the equation in the 'plain' form, and specify that you're shuffling for avoiding a div, and that should do. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-MUwpCZUn6Dl4RJD6s3us 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 iEYEABECAAYFAlOuKCoACgkQk4XaBE3IOsTGJwCfet6wSRQ8AHSIg1ATbkl0kINk 3dgAoI+X/N4wpQMFnk63m6mGVBfCQqZm =VTgq -----END PGP SIGNATURE----- --=-MUwpCZUn6Dl4RJD6s3us-- --===============6843196212109751425== 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 --===============6843196212109751425==--