From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 17/24] xen: credit2: soft-affinity awareness in runq_tickle() Date: Mon, 5 Sep 2016 16:55:26 +0200 Message-ID: <1473087326.19612.65.camel@citrix.com> References: <147145358844.25877.7490417583264534196.stgit@Solace.fritz.box> <147145437291.25877.11396888641547651914.stgit@Solace.fritz.box> <57C80882.90102@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5436771331803546052==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgvJD-0003xl-Ob for xen-devel@lists.xenproject.org; Mon, 05 Sep 2016 14:55:39 +0000 In-Reply-To: <57C80882.90102@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: anshul makkar , xen-devel@lists.xenproject.org Cc: "Justin T. Weaver" , George Dunlap List-Id: xen-devel@lists.xenproject.org --===============5436771331803546052== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-siEP1r8tmlzZzE23g6S1" --=-siEP1r8tmlzZzE23g6S1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-09-01 at 11:52 +0100, anshul makkar wrote: > On 17/08/16 18:19, Dario Faggioli wrote: > >=C2=A0 > > +=C2=A0=C2=A0=C2=A0=C2=A0/* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* We're doing soft-affinity, and we know= that the current > > vcpu on cpu > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* has a soft affinity. We now want to kn= ow whether cpu itself > > is in > Please can you explain the above statment. If the vcpu has soft > affinity=C2=A0 > and its currently executing, doesn;t it always means that its running > on=C2=A0 > one of the pcpu which is there in its soft affinity or hard affinity? > A vcpu will always run on a pcpu from its own hard-affinity (that's the definition of hard-affinity). On the other hand, a vcpu will, most of the time, run on a cpu from its own soft affinity, but can run on a cpu that is in its hard-affinity, but *IS NOT* in its soft-affinity. That's the definition of soft-affinity: the scheduler will try to run it there, but it that can't happen, it will run it will run it outside of it (but still within its hard-affinity, of course). So, yes, we know already that it's running in a cpu at least from its hard affinity, what is it exactly that you are not understanding? > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* such affinity. In fact, since we now t= hat new (in > > runq_tickle()) is > Typo:=C2=A0=C2=A0=C2=A0* such affinity. In fact, since now we know that n= ew (in=C2=A0 > runq_tickle()) is > Thanks. :-) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0- if cpu is not in cur's so= ft-affinity, we should indeed > > check to > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0see whether new= should preempt cur. If that will be the > > case, that > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0would be an imp= rovement wrt respecting soft affinity; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0- if cpu is in cur's soft-a= ffinity, we leave it alone and > > (in > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0runq_tickle()) = move on to another cpu. In fact, we don't > > want to > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0be too harsh wi= th someone which is running within its > > soft-affinity. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0This is safe be= cause later, if we don't fine anyone else > > during the > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0soft-affinity s= tep, we will check cpu for preemption > > anyway, when > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0doing hard-affi= nity. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*/ > Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-siEP1r8tmlzZzE23g6S1 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 iQIcBAABCAAGBQJXzYdgAAoJEBZCeImluHPuXIMQANqtJNeSMVl5w73jlCA2q+/1 whawb3cz+pvAZ2e6XZDTxsDDp96pc3FgSCmPwWl7KwMWkiLaUYQob5ani+wPZoI6 yY8pWv8mBaagzf5olGZvvkr/ZRTkNH/xOv3LTCkZEKjJiEDfEBvAtKiKyFNct0hj JFcmTe08MOZ1rb3zYEwjfw6GrnKATAmf/jFHVGi6zllDErHhti54e3YKW4Fky83i fmVv5LM8D7/1X0IUi+eLsENVCLZd7RJx3sg5xk+UtdkPEftsA9JDVw3BPy6DZkDc 0MJFZCCyKiMb/gAcgGyvmn1SXTSlMoriyBedHC+AsVIo8fHaScE7Gt6betPy7f2R E6NBapf3zr+RHzplKQdhX8Zn+dEtvcahHJ6JM7Tr610vMt0wy32qrCIE6aF7LnVM 3imSRRi2Cptda4WDLIJC/vM87MVeEqWErB65AbPyPTkDUsN6XccF6YPxCpAq+JZ4 o58uojSna3i6bNL/8No+hHvwtXu8ZbZ3rB8rZJ48wLfRWIC9bcxz6ARvt0d+U5UL UQLwk9PkUaPvSkcVJZgcHzq52Gw8CSt1/Q4a41aMUH3R4fDhhP+PViy6NSWHNgWJ x1Ik4IGKGnT3XlSUlmC/t0SDvmskbKYSo9mabvfYzZJAMZs+0/oLKRF1hVEeaUxC TmmWGBfOA6KMEQegv5fk =ixa/ -----END PGP SIGNATURE----- --=-siEP1r8tmlzZzE23g6S1-- --===============5436771331803546052== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============5436771331803546052==--