From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v7 15/17] vmx: VT-d posted-interrupt core logic handling Date: Wed, 16 Sep 2015 20:05:12 +0200 Message-ID: <1442426712.15327.33.camel@citrix.com> References: <1441960146-10569-1-git-send-email-feng.wu@intel.com> <1441960146-10569-16-git-send-email-feng.wu@intel.com> <1442423887.15327.29.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3964232130838255774==" Return-path: In-Reply-To: <1442423887.15327.29.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Feng Wu Cc: Kevin Tian , Keir Fraser , George Dunlap , Andrew Cooper , xen-devel@lists.xen.org, Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============3964232130838255774== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-j+yeQRTz1gHWOgcq6qdC" --=-j+yeQRTz1gHWOgcq6qdC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-09-16 at 19:18 +0200, Dario Faggioli wrote: > On Fri, 2015-09-11 at 16:29 +0800, Feng Wu wrote: > > One remaining item: > > Jan has concern about calling vcpu_unblock() in vmx_pre_ctx_switch_pi()= , > > need Dario or George's input about this. > >=20 > Hi, >=20 > Sorry for the delay in replying, I was on PTO for a few time. >=20 > Coming to the issue, well, it's a though call. >=20 > First of all, Feng, have you tested this with a debug build of Xen? I'm > asking because it looks to me that you're ending up calling vcpu_wake() > with IRQ disabled which, if my brain is not too rusty after a few weeks > of vacation, should result in check_lock() (in xen/common/spinlock.c) > complaining, doesn't it? >=20 Mmm.. My bad (so, yes, I'm a bit rusty, I guess). check_lock(), in case of spin_lock_irqsave(), is called _after_ local_irq_disable(), inside _spin_lock_irqsave(), so this above should not be an issue. Sorry for the noise. :-( The rest of what's said below, and the fact that I agree with George's and Jan's concerns, still stand. :-) So, in particular... > In fact, in principle this is not too much different from what happens > in other places. More specifically, what we have is a vcpu being > re-inserted in a runqueue, and the need for re-running the scheduler on > a(some) PCPU(s) is evaluated. That is similar to what happens in Credit2 > (and in RTDS) in csched2_context_saved(), which is called from within > context_saved(), still from the context switch code (if > __CSFLAG_delayed_runq_add is true). >=20 > So it's not the thing per se that is that terrible, IMO. The differences > between that and your case are: > - in the Credit2 case, it happens later down in the context switch > path (which would look already better to me) and, more important, > with IRQs already re-enabled; > - in the Credit2 case, the effect that something like that can have on= =20 > the scheduler is much more evident, as it happens inside a scheduler > hook, rather than buried down in arch specific code, which makes me a > lot less concerned about the possibility of latent issues Jan was > hinting at, with which I concur. >=20 > So, I guess, first of all, can you confirm whether or not it's exploding > in debug builds? And in either case (just tossing out ideas) would it be > possible to deal with the "interrupt already raised when blocking" case: > - later in the context switching function ? > - with another hook, perhaps in vcpu_block() ? >=20 ... let me/us know what you think about these alternatives. 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) --=-j+yeQRTz1gHWOgcq6qdC 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 iEYEABECAAYFAlX5r1gACgkQk4XaBE3IOsT8iACffctC4Rypt5KyyevMkXVJ6rcT jewAnisEQFtXNfcuWZNXzVaBxufHLr10 =ttuj -----END PGP SIGNATURE----- --=-j+yeQRTz1gHWOgcq6qdC-- --===============3964232130838255774== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============3964232130838255774==--