From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 1/1] xen: move TLB-flush filtering out into populate_physmap during vm creation Date: Thu, 8 Sep 2016 13:01:40 +0200 Message-ID: <1473332500.19612.145.camel@citrix.com> References: <1473312603-28581-1-git-send-email-dongli.zhang@oracle.com> <20160908105047.GB12697@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8648030524962416131==" Return-path: In-Reply-To: <20160908105047.GB12697@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wei Liu , Dongli Zhang Cc: sstabellini@kernel.org, george.dunlap@eu.citrix.com, tim@xen.org, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, david.vrabel@citrix.com, jbeulich@suse.com, andrew.cooper3@citrix.com List-Id: xen-devel@lists.xenproject.org --===============8648030524962416131== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-GXl/ChbaQkYEDeV1acJd" --=-GXl/ChbaQkYEDeV1acJd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-09-08 at 11:50 +0100, Wei Liu wrote: > On Thu, Sep 08, 2016 at 01:30:03PM +0800, Dongli Zhang wrote: > >=C2=A0 > > diff --git a/xen/common/schedule.c b/xen/common/schedule.c > > index 32a300f..593541a 100644 > > --- a/xen/common/schedule.c > > +++ b/xen/common/schedule.c > > @@ -1376,6 +1376,11 @@ static void schedule(void) > > =C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0next =3D next_slice.task; > > =C2=A0 > > +=C2=A0=C2=A0=C2=A0=C2=A0/* Set already_scheduled to 1 when this domain= gets scheduled > > for the > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* first time */ > > +=C2=A0=C2=A0=C2=A0=C2=A0if ( next->domain->already_scheduled =3D=3D 0 = ) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0next->domain->already_= scheduled =3D 1; > > + > Can be simplified by omitting the "if" altogether.=C2=A0=C2=A0 > Are you sure? I mean looking at the cases when the flag is already true (which means, during the life of a domain, basically **always** except a handful of instances after creation), what costs less, a check that is always false, or a write that is always updating a value with its current value? And I'm not being ironic or anything, I honestly am not sure and this is a genuine question. > And use "true" here. >=20 Yeah, or just: =C2=A0if ( unlikely(!next->domain->already_scheduled) ) =C2=A0 =C2=A0 =C2=A0... > Wei. --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-GXl/ChbaQkYEDeV1acJd 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 iQIcBAABCAAGBQJX0UUVAAoJEBZCeImluHPuK7UP/R1NjilZpaFT4xCvSAWYmUos tZDz6SDaqA3b8nyuUyhs619A3LkSGK0uY7tIRBaUvwGq45x7+5Czug1IRQoaAesq BY5qHVoBwq8UxHElSiIP+BdTXsqVaJNuNm4Q6Ts7FDWrFJRkbya4I0rMHT6JvIX+ jpxNKbEIQWcuVpROZHzbS/3Agpy9MF2NnDoi8rx0F9CwZxFxpkwc+RC0opSs4FTT lmoSZgrqcLYfpKEvHVTE8Odw9+DPCTxuo99lYeqQKBT/cyaTDRlZUNl2O2hZZYFv uMkvPM30XyzJ/nDLl9gqzMmplhxzgBBbVRlfxjXac7OJKZ7fWpKz3DIUhu6SC/Sa t9ERUYtsDfULyNfEN3iblhWC3fQdLEUYmMLHcuxuBtLfKWXfaAoU8KnvHkU8szny pYklYSlFLr0XDdecVEyc3FZOnp6d4Rb2o98UUPO6WPe3Ov5FSNXLa1Ig8imh5+Lf sk+9yS/LxN3VESnHlgQIIQzVbTbtnwCKHabG65fD9Pq/vDT+tmAOObWcmM3RBqJu Kfo/0AsSYwbnrEnS4JP74J2QTsZQ8MQxNu6UjOb6vlBMjdkc2HuK/Zfcc0641EbL I78I+vlWLnm7BSvkMYebODQBGnWTBitaRkKG+6kivL5YcSf7r6j+FV+QvNoKcIKk +Ns2CaYND6KS88KkVUDW =ke6Z -----END PGP SIGNATURE----- --=-GXl/ChbaQkYEDeV1acJd-- --===============8648030524962416131== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============8648030524962416131==--