From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 5/7] xen: sched: get rid of the per domain vCPU list in Credit2 Date: Thu, 8 Oct 2015 17:32:45 +0200 Message-ID: <1444318365.22254.29.camel@citrix.com> References: <20151008124027.12522.42552.stgit@Solace.station> <20151008125305.12522.60745.stgit@Solace.station> <56167628.6050400@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6105479572904056160==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZkDBd-0000Hb-II for xen-devel@lists.xenproject.org; Thu, 08 Oct 2015 15:32:53 +0000 In-Reply-To: <56167628.6050400@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 , xen-devel@lists.xenproject.org Cc: George Dunlap List-Id: xen-devel@lists.xenproject.org --===============6105479572904056160== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-eI1TwGc1NSBZx109Gr+0" --=-eI1TwGc1NSBZx109Gr+0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2015-10-08 at 14:56 +0100, Andrew Cooper wrote: > On 08/10/15 13:53, Dario Faggioli wrote: > > @@ -1443,7 +1433,7 @@ csched2_dom_cntl( > > =20 > > if ( op->u.credit2.weight !=3D 0 ) > > { > > - struct list_head *iter; > > + struct vcpu *vc; >=20 > Any chance of starting to align on the more common practice of just v > for a vcpu? >=20 I see. I'm a bit split, though. It's v in schedule.c, but it's **always** (with only 2 exceptions) vc in sched_*.c. I know that, if we want to align, we need to start from somewhere, but OTOH, consistency is rather helpful when reading this code. I'll think about it... > > @@ -1539,9 +1528,7 @@ csched2_free_domdata(const struct scheduler > > *ops, void *data) > > static void > > csched2_dom_destroy(const struct scheduler *ops, struct domain > > *dom) > > { > > - struct csched2_dom *sdom =3D CSCHED2_DOM(dom); > > - > > - BUG_ON(!list_empty(&sdom->vcpu)); > > + BUG_ON(CSCHED2_DOM(dom)->nr_vcpus !=3D 0); >=20 > This is a latent bug (excuse the pun) which can be triggered by > userspace. There is no guarantee or requirement that a domain > registered with a scheduler has vcpus. >=20 Mmm... I think the original check wanted to catch cases where a domain (or, at least, its scheduling related bits) is being destroyed with vcpus still on. While trying to retain the BUG_ON, even with sdom->vcpu not being there any longer, I probably went too far. BUG_ON(CSCHED2_DOM(dom)->nr_vcpus > 0); should be fine, I think. Thanks and Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-eI1TwGc1NSBZx109Gr+0 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 iEYEABECAAYFAlYWjJ0ACgkQk4XaBE3IOsQXAACgovu4+Gjp4TUh5RBvP0rSAz70 dh4An3FCsTciqhsXz3RO8dJIIzw79r/1 =Xand -----END PGP SIGNATURE----- --=-eI1TwGc1NSBZx109Gr+0-- --===============6105479572904056160== 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 --===============6105479572904056160==--