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: Thu, 8 Oct 2015 22:39:53 +0200 Message-ID: <1444336793.22254.72.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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1091261961489724749==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZkHyt-000252-W5 for xen-devel@lists.xenproject.org; Thu, 08 Oct 2015 20:40:04 +0000 In-Reply-To: <561689B6.4020306@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 --===============1091261961489724749== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-rf/RcOeapCbK+8LcD6cQ" --=-rf/RcOeapCbK+8LcD6cQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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() >=20 > 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. 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... :-/ 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? > > , which for the credit scheduler wants to put things on the > > runqueue. Lock taken in interrupt context =3D> interrupts must be > > disabled whenever taking the lock, yes? >=20 > Correct, which is the purpose of the ASSERT()s in the _irq() and > _irqsave() variants. >=20 What ASSERT()? I don't find any assert in _spin_lock_irqsave() (which thing makes sense to me): unsigned long _spin_lock_irqsave(spinlock_t *lock) { unsigned long flags; local_irq_save(flags); _spin_lock(lock); return flags; } Note that, again, I'm not just being nitpicking, for the sake of it... I'm trying to understand, as I'm interesting in trying making things better. :-) Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-rf/RcOeapCbK+8LcD6cQ 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 iEYEABECAAYFAlYW1JkACgkQk4XaBE3IOsTPuQCffo6gNbE3EOqY0En1c8wbUCxs jE4An33FtmrZYX21RJ4vM9b5iZCWb0d2 =+LhR -----END PGP SIGNATURE----- --=-rf/RcOeapCbK+8LcD6cQ-- --===============1091261961489724749== 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 --===============1091261961489724749==--