From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 3/9] xen: sched: make locking for {insert, remove}_vcpu consistent Date: Fri, 9 Oct 2015 18:56:17 +0200 Message-ID: <1444409777.3009.13.camel@citrix.com> References: <20150929164726.17589.96920.stgit@Solace.station> <20150929165549.17589.76223.stgit@Solace.station> <560ACAD5.8040405@citrix.com> <56168479.60703@citrix.com> <561689B6.4020306@citrix.com> <1444336793.22254.72.camel@citrix.com> <5617BB85.3090703@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4361768061098468947==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZkayO-0001wu-MJ for xen-devel@lists.xenproject.org; Fri, 09 Oct 2015 16:56:48 +0000 In-Reply-To: <5617BB85.3090703@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: Andrew Cooper , George Dunlap , xen-devel@lists.xenproject.org Cc: George Dunlap , Meng Xu List-Id: xen-devel@lists.xenproject.org --===============4361768061098468947== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-PM8mKAGGGE0qOJE+783l" --=-PM8mKAGGGE0qOJE+783l Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-10-09 at 14:05 +0100, Andrew Cooper wrote: > On 08/10/15 21:39, Dario Faggioli wrote: > > On Thu, 2015-10-08 at 16:20 +0100, Andrew Cooper wrote: > > > On 08/10/15 15:58, George Dunlap wrote: > > > > Generic scheduling code is called from interrupt contexts -- > > > > namely, > > > > vcpu_wake() > > > There are a lot of codepaths, but I cant see one which is > > > definitely > > > called with interrupts disables. (OTOH, I can see several where > > > interrupts are definitely enabled). > > >=20 > > Sorry, it's certainly me, but I don't think I understand this. > >=20 > > AFAICT, you are saying that you fail to find in the code, > > situations > > the scheduler code is invoked, with interrupts already disabled, is > > this correct? In particular "definitely called with interrupt > > disabled" > > is what confuses me... :-/ >=20 > Given a brief look at the code, I can't spot a codepath where it is > obvious that interrupts are disabled. >=20 Ok, thanks for rephrasing it (and for bearing with me :-). > > Also (assuming what I just said is what you meant), are you > > referring > > "just" to schedule(), or even to other scheduler's code, which also > > disables interrupt when taking the lock(s) it needs, like, e.g., > > vcpu_wake() as George said? >=20 > I was looking on callchains involving vcpu_wake(). >=20 Ok, thanks for clarifying this too. AFAIUI for now, the issue is more whether we are in interrupt context, rather than whether or not interrupt are disabled already. That is, whether or not, by not deactivating interrupt when taking the {v,p}cpu_schedule_lock(), we can deadlock a pCPU (and, in case that can happen, how to avoid that). Anyway, I think this is interesting (it is for me, at least :-)) and worthwhile enough to investigate a bit more. I'll dig and report. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-PM8mKAGGGE0qOJE+783l 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 iEYEABECAAYFAlYX8bEACgkQk4XaBE3IOsSLlgCgicymmcqtV2xjeuhIdA8wNUat jnwAn3RS1ySO/bZXTwi4CKhteN3TjdiC =/WFa -----END PGP SIGNATURE----- --=-PM8mKAGGGE0qOJE+783l-- --===============4361768061098468947== 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 --===============4361768061098468947==--