From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2 2/7] xen: credit: (micro) optimize csched_runq_steal(). Date: Fri, 7 Apr 2017 13:01:02 +0200 Message-ID: <1491562862.3287.9.camel@citrix.com> References: <149146456487.21348.8554211499146017782.stgit@Solace.fritz.box> <149146657883.21348.4003508836159742945.stgit@Solace.fritz.box> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0479958868361334622==" 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 1cwRdk-000737-KB for xen-devel@lists.xenproject.org; Fri, 07 Apr 2017 11:01:16 +0000 In-Reply-To: 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 Cc: George Dunlap , Anshul Makkar List-Id: xen-devel@lists.xenproject.org --===============0479958868361334622== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-hfErYO0QyNmqzozT3ZRT" --=-hfErYO0QyNmqzozT3ZRT Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2017-04-07 at 11:49 +0100, George Dunlap wrote: > On 06/04/17 09:16, Dario Faggioli wrote: > > --- a/xen/common/sched_credit.c > > +++ b/xen/common/sched_credit.c > > @@ -708,12 +708,10 @@ static inline int > > =C2=A0__csched_vcpu_is_migrateable(struct vcpu *vc, int dest_cpu, > > cpumask_t *mask) > > =C2=A0{ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* Don't pick up work that's in the peer'= s scheduling tail or > > hot on > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* peer PCPU. Only pick up work that pref= ers and/or is allowed > > to run > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* on our CPU. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* Don't pick up work that's hot on peer = PCPU, or that can't > > (or > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* would prefer not to) run on cpu. > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*/ > > -=C2=A0=C2=A0=C2=A0=C2=A0return !vc->is_running && > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0!__c= sched_vcpu_is_cache_hot(vc) && > > +=C2=A0=C2=A0=C2=A0=C2=A0return !__csched_vcpu_is_cache_hot(vc) && > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0cpumask_test_cpu(dest_cpu, mask); >=20 > +1 to moving the check earlier; but there's a risk that this function > will be used somewhere else and that the is_running check will be > missed. >=20 > Should we maybe add an ASSERT() here (perhaps with a comment that the > check can be added back in if necessary)? >=20 Ok, makes sense. Will do. Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-hfErYO0QyNmqzozT3ZRT 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 iQIcBAABCAAGBQJY53FuAAoJEBZCeImluHPud0AP/RPYItvGR7sDGmN/jbUVxSg2 9rNy57kAHcYbwfORGqIxkDeFh8X3Y02IvpDVyH8NsB+u+YvtMykT2pbeqpdeaOyP naRUI+E44Rcdh8zvU8Zlx9P4tLqJCDW2heQW68/tQEJaFjFDuHS11ZpBdi+JiPZh o1ukRZFz96irkPHfIWBtpD+ZVjweIiv4PSI2M3kwlxYu7emjEKQ95BqUmCqQ6/pt F3Zl6gpeKTtodm84bueMF1iHQpKh9gVyAhBCz6LoKZsNz03jRZ/F9V8g+762Xczy wgweQ2J43KkYKeQ8PgT1suDo966Gt08oteRENoLKnwijmVWB5U0lIfjbSZLQ9SLx YiKnvGsHwn9emfFg4J8M2vZhtHQhih+Psr+HSOE769EzRnFOipx+B10K35nXu1yD 2yH2mv6FwQZVdSHe3TiDfZY4lPhhtaAS9QooZnBI1iyMHHhBuZjCF88JMzPQMyZ/ I1wZ4pn4VMTqj5yReDDjVz0G6V4Nicrs1tvoJNJPi45Tasc4yswZkAyl6ey9FpmR Exu+o0GwKQEie1FYqg58qwiqST/kH4C+FxKVgby0RMk4QPCQFEx1opohQ2KraUfj WQ3k2l895hzdk2F5tJkZM421jCik/TndAMQtVxH04YcSjlmdihAY8E5caE9usmWW kY7ZjeiQE9gOBK6hhtXx =240f -----END PGP SIGNATURE----- --=-hfErYO0QyNmqzozT3ZRT-- --===============0479958868361334622== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============0479958868361334622==--