From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 5/7] xen: sched: get rid of the per domain vCPU list in Credit2 Date: Thu, 8 Oct 2015 14:56:56 +0100 Message-ID: <56167628.6050400@citrix.com> References: <20151008124027.12522.42552.stgit@Solace.station> <20151008125305.12522.60745.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZkBgq-0007hJ-OR for xen-devel@lists.xenproject.org; Thu, 08 Oct 2015 13:57:00 +0000 In-Reply-To: <20151008125305.12522.60745.stgit@Solace.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli , xen-devel@lists.xenproject.org Cc: George Dunlap List-Id: xen-devel@lists.xenproject.org On 08/10/15 13:53, Dario Faggioli wrote: > @@ -1443,7 +1433,7 @@ csched2_dom_cntl( > > if ( op->u.credit2.weight != 0 ) > { > - struct list_head *iter; > + struct vcpu *vc; Any chance of starting to align on the more common practice of just v for a vcpu? > @@ -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 = CSCHED2_DOM(dom); > - > - BUG_ON(!list_empty(&sdom->vcpu)); > + BUG_ON(CSCHED2_DOM(dom)->nr_vcpus != 0); 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. ~Andrew