From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2 1/5] xen: sched: improve robustness (and rename) DOM2OP() Date: Fri, 7 Apr 2017 11:05:38 +0200 Message-ID: <1491555938.3287.1.camel@citrix.com> References: <149152426922.31941.6054159629649244529.stgit@Solace.fritz.box> <149152523265.31941.6787732353764983034.stgit@Solace.fritz.box> <7f147d09-2241-aec3-7568-98d7b5534022@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7877245361557932456==" Return-path: Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwPqC-0003F0-5Q for xen-devel@lists.xenproject.org; Fri, 07 Apr 2017 09:06:00 +0000 In-Reply-To: <7f147d09-2241-aec3-7568-98d7b5534022@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: George Dunlap , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org --===============7877245361557932456== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-qkdeG4T8dMZ5zMTY9tCW" --=-qkdeG4T8dMZ5zMTY9tCW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2017-04-07 at 09:44 +0100, George Dunlap wrote: > On 07/04/17 01:33, Dario Faggioli wrote: > > Clarify and enforce (with ASSERTs) when the function > > is called on the idle domain, and explain in comments > > what it means and when it is ok to do so. > >=20 > > While there, change the name of the function to a more > > self-explanatory one, and do the same to VCPU2OP. > >=20 > > Signed-off-by: Dario Faggioli >=20 > Acked-by: George Dunlap >=20 > With one nit... >=20 > > --- a/xen/common/schedule.c > > +++ b/xen/common/schedule.c > > @@ -77,8 +77,25 @@ static struct scheduler __read_mostly ops; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(( (opsptr)= ->fn !=3D NULL ) ? (opsptr)->fn(opsptr, > > ##__VA_ARGS__ )=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: (ty= peof((opsptr)->fn(opsptr, ##__VA_ARGS__)))0 ) > > =C2=A0 > > -#define DOM2OP(_d)=C2=A0=C2=A0=C2=A0=C2=A0(((_d)->cpupool =3D=3D NULL)= ? &ops : ((_d)- > > >cpupool->sched)) > > -static inline struct scheduler *VCPU2OP(const struct vcpu *v) > > +static inline struct scheduler *dom_scheduler(const struct domain > > *d) > > +{ > > +=C2=A0=C2=A0=C2=A0=C2=A0if ( likely(d->cpupool !=3D NULL) ) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return d->cpupool->sch= ed; > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0/* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* If d->cpupool is NULL, this is the idl= e domain. This is > > special > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* because the idle domain does not reall= y bolong to any > > cpupool, and, >=20 > *belong >=20 Ah. Sorry! :-( > I can fix this up on check-in if need be. >=20 Yes, feel free. And the same for the other typo reported by Alan in 3/5, if you're up for it (and it's the case that there aren't any other reason to resend, of course). Thanks, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-qkdeG4T8dMZ5zMTY9tCW 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 iQIcBAABCAAGBQJY51ZkAAoJEBZCeImluHPuURYP/R76wBB1KEAq1LODDnSA9rlZ im+iDg4GIAmBZJoUjPWDU8G4mrrjGaXvJ7OohEo6B1dlICltEpocL9u2ovCZgp1Y H6zOhbyaCLEdiq4BSxT23mmg2hGXpHntNESWBui6HQ4u0P6L+mdpZlu9D1YTqZ6V xv/4hztJd2ilXz77ogCJt7Bg516V1nttKr1nGDcKlCK6PQTI2hgtnQZNOvkjUycl r8vVcK9FkZOjWI5LlsaFBGkASPfdIDgheb18uVqrvhAaQit0USquEw6r1+8MNzkz oCLHaUEp+7sXvSLGZHQrqqS8EBk4YM5jD01P3uwDCSgloj58ljcJc3nBlISgbuZ4 X/WVXlEfswrocfMrUV5qSR0/aW9az814fYF4J/qdPDgjRrJFZIYanBZGfYcz08DB 6gqf1cs9knZ+d/HYFFCWVHRvgWf8ziDd/Wt9hYzAyFSPgV+P13zm9VbrFANVE51L Xts5cgcoL+kUmBDIkxYqP0mPdAMF2HKrtzG3Je/oZQ2vBozFrVMdui3fDTFSPWFc b9wE3lrvQ22uuCcMVRCwOkPUaRcuhCpVieK6Cd9+7Jrqut6e1xOdzK1H3INttxfV asaePlORpq0hBUkuC9Gjp+NjHOfTRmCRHxSjAcdOPuQDuYo+0mNJwDuiKOpVAkjK w/3yFGp/7AW3Wzi4rfDF =c8FI -----END PGP SIGNATURE----- --=-qkdeG4T8dMZ5zMTY9tCW-- --===============7877245361557932456== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============7877245361557932456==--