From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] Remove a set operation for VCPU_KICK_SOFTIRQ when post interrupt to vm. Date: Fri, 18 Sep 2015 14:56:01 +0200 Message-ID: <1442580961.2691.23.camel@citrix.com> References: <1441637175-18070-1-git-send-email-john.liuqiming@huawei.com> <55ED9E00.2010105@huawei.com> <55EDBF4002000078000A07B1@prv-mh.provo.novell.com> <55EE5EF6.50406@huawei.com> <55FBAF8D02000078000D8FB4@prv-mh.provo.novell.com> <55FBF92F.2090505@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0962197912966790822==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZcvD1-0004vI-I0 for xen-devel@lists.xenproject.org; Fri, 18 Sep 2015 12:56:11 +0000 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: "Zhang, Yang Z" , Andrew Cooper , Jan Beulich , "hanweidong@huawei.com" , "john.liuqiming@huawei.com" Cc: "xen-devel@lists.xenproject.org" , "zw.zhang@huawei.com" List-Id: xen-devel@lists.xenproject.org --===============0962197912966790822== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-OXn1ZDCLSi903JU8MRCv" --=-OXn1ZDCLSi903JU8MRCv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-09-18 at 11:50 +0000, Zhang, Yang Z wrote: > Andrew Cooper wrote on 2015-09-18: > > On 18/09/15 12:40, Zhang, Yang Z wrote: > > > But it only happens before do vmentry. Is it possible that > > VCPU been preempted at any time when running in hypervisor mode? > >=20 > > All vcpus may be preempted at any time by the Xen scheduler. > >=20 > > However, paths through the hypervisor are synchronous, so a vcpu > > will > > notice that it has been preempted on the return-to-guest path, and > > a > > context switch will occur as appropriate. >=20 > So the context switch only occurs on the return-to-guest patch or if > the VCPU call schedule() by itself. It seems a little different from > linux kernel which possible to preempt a task at any point. >=20 It is, indeed. Xen does not 'preempt itself', like Linux does, and you also don't call schedule() directly (like Linux does). In fact, any time you want to reschedule, you need to raise SCHEDULE_SOFTIRQ, which is then checked and serviced in do_softirq() (and, for instance, not in process_pending_softirq(), specifically to avoid preemptions!). Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-OXn1ZDCLSi903JU8MRCv 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 v1 iEYEABECAAYFAlX8CeIACgkQk4XaBE3IOsTuYgCfeF99XLhbcPFnqoEIITRgyxZe k+8An15tba5/HwG2XZLta1q3v5DplcVe =lVj5 -----END PGP SIGNATURE----- --=-OXn1ZDCLSi903JU8MRCv-- --===============0962197912966790822== 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 --===============0962197912966790822==--