From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [v3 12/15] vmx: posted-interrupt handling when vCPU is blocked Date: Thu, 2 Jul 2015 10:30:20 +0200 Message-ID: <1435825820.25170.416.camel@citrix.com> References: <1435123109-10481-1-git-send-email-feng.wu@intel.com> <1435123109-10481-13-git-send-email-feng.wu@intel.com> <55926B62.1000605@citrix.com> <1435757162.25170.354.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9010152129480881104==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Wu, Feng" Cc: "Tian, Kevin" , "keir@xen.org" , "george.dunlap@eu.citrix.com" , Andrew Cooper , "xen-devel@lists.xen.org" , "jbeulich@suse.com" , "Zhang, Yang Z" List-Id: xen-devel@lists.xenproject.org --===============9010152129480881104== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-+MKpwLTS/0Mt1IH8QOlR" --=-+MKpwLTS/0Mt1IH8QOlR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2015-07-02 at 04:27 +0000, Wu, Feng wrote: > > > > + list_for_each_entry(vmx, &per_cpu(pi_blocked_vcpu, cpu), > > > > + pi_blocked_vcpu_list) > > > > + if ( vmx->pi_desc.on ) > > > > + tasklet_schedule(&vmx->pi_vcpu_wakeup_tasklet); > > > > > > There is a logical bug here. If we have two NV's delivered to this > > > pcpu, we will kick the first vcpu twice. > > > > > > On finding desc.on, a kick should be scheduled, then the vcpu removed > > > from this list. With desc.on set, we know for certain that another N= V > > > will not arrive for it until it has been scheduled again and the > > > interrupt posted. > > > > > Yes, that seems a possible issue (and one that should indeed be > > avoided). > >=20 > > I'm still unsure about the one that I raised myself but, if it is > > possible to have more than one vcpu in a pcpu list, with desc.on=3D=3Dt= rue, > > then it looks to me that we kick all of them, for each notification. > >=20 > > Added what Andrew's spotted, if there are a bunch of vcpus, queued with > > desc.on=3D=3Dture, and a bunch of notifications arrives before the task= let > > gets executed, we'll be kicking the whole bunch of them for a bunch of > > times! :-/ >=20 > As Andrew mentioned, removing the vCPUs with desc.on =3D true from the > list can avoid kick vCPUs for multiple times. >=20 It avoids kicking vcpus multiple times if more than one notification arrives, yes. It is, therefore, not effective in making sure that, even with only one notification, you only kick the interested vcpu. This is the third time that I ask: (1) whether it is possible to have more vcpus queued on one pcpu PI=20 blocked list with desc.on (I really believe it is); (2) if yes, whether it is TheRightThing(TM) to kick all of them, as soon as any notification arrives, instead that putting together a mechanism for kicking only a specific one. The fact that you're not answering is not so much of a big deal for me... I'll just keep asking! :-D Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-+MKpwLTS/0Mt1IH8QOlR 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 iEYEABECAAYFAlWU9pwACgkQk4XaBE3IOsQCDACdEI3+lH4q7v6bLmfjza7yNNK2 GO0AoJxCuQ/tLRalPAaPyGSYqvHhU/N8 =mcqE -----END PGP SIGNATURE----- --=-+MKpwLTS/0Mt1IH8QOlR-- --===============9010152129480881104== 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 --===============9010152129480881104==--