From: Wei Liu Subject: Re: [PATCH V5 03/32] xl / libxl: push VCPU affinity pinning down to libxl Date: Thu, 15 May 2014 18:19:55 +0100 Message-ID: <20140515171955.GE10525@zion.uk.xensource.com> References: <1400018054-26038-1-git-send-email-wei.liu2@citrix.com> <1400018054-26038-4-git-send-email-wei.liu2@citrix.com> <1400172319.883.29.camel@kazak.uk.xensource.com> <20140515170650.GB10525@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20140515170650.GB10525@zion.uk.xensource.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: Ian Campbell Cc: ian.jackson@eu.citrix.com, Dario Faggioli , Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, May 15, 2014 at 06:06:50PM +0100, Wei Liu wrote: [...] > > > @@ -833,11 +823,30 @@ static void parse_config_data(const char *config_source, > > > exit(1); > > > } > > > libxl_bitmap_set(&b_info->cpumap, i); > > > - if (n_cpus < b_info->max_vcpus) > > > - vcpu_to_pcpu[n_cpus] = i; > > > + if (n_cpus < b_info->max_vcpus) { > > > + kvl = xrealloc(kvl, sizeof(char *) * (len * 2 + 2)); > > > > Can't you get the length of the input list and just allocate the right > > size to start with? > > > > That introduces extra overhead. Say if you have 32 VCPU but only want to > pin a few. > I misread this one. I think you're right. But how can I can the length of this list? Could not find an appropriate API. I guess I need to do it myself? Wei. > Wei. > > > Ian.