From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v8]xen: sched: convert RTDS from time to event driven model Date: Mon, 14 Mar 2016 17:35:22 +0100 Message-ID: <1457973322.3102.694.camel@citrix.com> References: <1457724196-4760-1-git-send-email-tiche@seas.upenn.edu> <1457956687.3102.657.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7218164825080880191==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afVSv-0007Na-VG for xen-devel@lists.xenproject.org; Mon, 14 Mar 2016 16:35:34 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Meng Xu Cc: "xen-devel@lists.xenproject.org" , Tianyang Chen , George Dunlap , Dagaen Golomb List-Id: xen-devel@lists.xenproject.org --===============7218164825080880191== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-CTGbcHYhh1uX8+sLL2nf" --=-CTGbcHYhh1uX8+sLL2nf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2016-03-14 at 12:03 -0400, Meng Xu wrote: > On Mon, Mar 14, 2016 at 11:38 AM, Meng Xu > wrote: > >=C2=A0 > > I'm ok that we keep using spin_lock_irqsave() for now. But maybe > > later, it will be a better idea to explore if spin_lock_irq() can > > replace all spin_lock_irqsave() in the RTDS scheduler? > >=C2=A0 > I rethink about the choice of replacing spin_lock_irqsave with > spin_lock_irq(). > If in the future ,we will introduce new locks and there may exit the > situaiton when we want to lock two locks in the same function. In > that > case, we won't use spin_lock_irq() but have to use > spin_lock_irqsave(). If we can mix up spin_lock_irq() with > spin_lock_irqsave() in different fucntiosn for the same lock, which I > think we can (right?), we should be fine. Otherwise, we will have to > keep using spin_lock_irqsave(). >=20 Mixing per se is not a problem, it's how you mix... If you call spin_unlock_irq() within a critical section protected by either spin_lock_irq() or spin_lock_irqsave(), that is not a good mix! :-) if you call _irqsave() inside a critical section protected by either _irq() or _irqsave(), that's what should be done (it's the purpose of _irqsave(), actually!). Actually, in case of nesting, most of the time the inner lock can be taken by just spin_lock(). Look, for instance, at=C2=A0csched2_dump_pcpu(). With more locks (which I agree is something we want for RTDS), the biggest issue is going to be getting the actual nesting right, rather than the various _irq* variants. :-) Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-CTGbcHYhh1uX8+sLL2nf 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 iEYEABECAAYFAlbm6EoACgkQk4XaBE3IOsRnMwCdGMEShKwLx0mJSqVvqKWGO5Ww uUAAniDhMQFneZe5WyJ3X4HKcCN5lvWE =jJ7G -----END PGP SIGNATURE----- --=-CTGbcHYhh1uX8+sLL2nf-- --===============7218164825080880191== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============7218164825080880191==--