From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 01/19] xen: sched: leave CPUs doing tasklet work alone. Date: Thu, 7 Jul 2016 12:11:52 +0200 Message-ID: <1467886312.23985.41.camel@citrix.com> References: <146620492155.29766.10321123657058307698.stgit@Solace.fritz.box> <146620508199.29766.7439697154591443704.stgit@Solace.fritz.box> <5767BBED02000078000F67D0@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4134110511769798335==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL6Hm-0000GB-Pz for xen-devel@lists.xenproject.org; Thu, 07 Jul 2016 10:11:58 +0000 In-Reply-To: <5767BBED02000078000F67D0@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Jan Beulich Cc: xen-devel@lists.xenproject.org, Anshul Makkar , David Vrabel , George Dunlap List-Id: xen-devel@lists.xenproject.org --===============4134110511769798335== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-uRYRpLoMZxosBQn2IxUD" --=-uRYRpLoMZxosBQn2IxUD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2016-06-20 at 01:48 -0600, Jan Beulich wrote: > > > > On 18.06.16 at 01:11, wrote: > > --- a/xen/common/sched_credit.c > > +++ b/xen/common/sched_credit.c > > @@ -1819,24 +1819,24 @@ csched_schedule( > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0else > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0snext =3D csched_= load_balance(prv, cpu, snext, > > &ret.migrated); > > =C2=A0 > > + out: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* Update idlers mask if necessary. = When we're idling, other > > CPUs > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* will tickle us when they get extr= a work. > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*/ > > -=C2=A0=C2=A0=C2=A0=C2=A0if ( snext->pri =3D=3D CSCHED_PRI_IDLE ) > > +=C2=A0=C2=A0=C2=A0=C2=A0if ( tasklet_work_scheduled || snext->pri !=3D= CSCHED_PRI_IDLE ) > > =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=A0if ( !cpumask_test_cpu= (cpu, prv->idlers) ) > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0cpumask_set_cpu(cpu, prv->idlers); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if ( cpumask_test_cpu(= cpu, prv->idlers) ) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0cpumask_clear_cpu(cpu, prv->idlers); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > > -=C2=A0=C2=A0=C2=A0=C2=A0else if ( cpumask_test_cpu(cpu, prv->idlers) ) > > +=C2=A0=C2=A0=C2=A0=C2=A0else if ( !cpumask_test_cpu(cpu, prv->idlers) = ) > > =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=A0cpumask_clear_cpu(cpu,= prv->idlers); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cpumask_set_cpu(cpu, p= rv->idlers); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > Is there a reason for this extra code churn? It would seem to me > that the change could be just the "out" label movement and > adjustment to the first if: >=20 > =C2=A0=C2=A0=C2=A0if ( !tasklet_work_scheduled && snext->pri =3D=3D CSCHE= D_PRI_IDLE ) >=20 > Am I overlooking something? >=20 No, you are not. It indeed can be done as you suggest, and it's better, so I'll go for it. Thanks and regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-uRYRpLoMZxosBQn2IxUD 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 iQIcBAABCAAGBQJXfiroAAoJEBZCeImluHPu2M0P/2wFh9nncL64GAlng8rIShVl In/+O42mFh5TRk5akJgAiwW3NwVnb3OBs29gKz4YqNBbpUcGsKA+6Z3SgAnngm95 etToq8Yi7KaJLTrIrxughsp2Mx3p8kFt1MWPPHTHIOI//ciWkiTnmLFRH8FYi3NF ywWIUyPWFOMr8B1UKXOourMiwmVT0oay9ZXNuRTxooiACNRVY0qQ19upBPRv+XaG 9NgbHItDFQZsnbOoun2b40twvloSVjCseGBoo5t1na1D+LsDMidoeCLnD2nv4AHD dUpmB4BW8Cr2O6jus39lEI3EKLdLONm978tabyrpOw0h3VaQsuaUHxLoWsZQgvq8 uZ20C9S3Gu+4XBxC8nOk+CfF3Ya9mSIxPTMnMipJRCJK3Hb+OCY985k3ia/9yqQu XGdfKygYwGl58NisF3oZ0WM5aPkcU6az1U3Owbq74F5H0rkpXrQxKtpp2mlpRr5S wvgLZowaV1WyaECgApxXeIejQZa2AUp2NvDS38LpZBmdliBuq/3rVeRCZa4REIs2 pbDhiLBHwN2oArPT98XBd5ay1epC+cGBUkfR6/xy6WswMC3nBAgwYtxWRVzIrrwW k3cjD/BIXr8+/0mS1XDisoBVqjquVMpbctiwGrp1OR8zmgoG6axE6vo9txxAXc7V EUrtnQeJbzwtoSLwEyP1 =7sCo -----END PGP SIGNATURE----- --=-uRYRpLoMZxosBQn2IxUD-- --===============4134110511769798335== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============4134110511769798335==--