From: Wei Liu Subject: Re: [PATCH v9 9/9] libxl: automatic NUMA placement affects soft affinity Date: Thu, 19 Jun 2014 18:42:56 +0100 Message-ID: <20140619174256.GS20819@zion.uk.xensource.com> References: <20140618141449.21586.55528.stgit@Solace> <20140618142849.21586.23269.stgit@Solace> <1403199230.12893.20.camel@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1403199230.12893.20.camel@Solace> 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 Cc: Wei Liu , Ian.Campbell@citrix.com, Andrew.Cooper3@citrix.com, George.Dunlap@citrix.com, xen-devel@lists.xen.org, Ian.Jackson@citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, Jun 19, 2014 at 07:33:50PM +0200, Dario Faggioli wrote: [...] > > - rc = numa_place_domain(gc, domid, info); > > + rc = libxl_cpu_bitmap_alloc(ctx, &cpumap_soft, 0); > > if (rc) > > return rc; > > + > > + rc = numa_place_domain(gc, domid, info); > > + if (rc) { > > + libxl_bitmap_dispose(&cpumap_soft); > > + return rc; > > + } > > + > > > Do I need this call to libxl_bitmap_dispose(), to avoid leaking what > libxl_cpu_bitmap_alloc() did upon return, or does libxl cleans this up > for me? :-) > > As you can see, I'm talking about the case where I'm inside libxl (i.e., > within libxl__build_pre() ) > Yes, you need to call _dispose. The bitmap is allocated with NOGC so libxl won't free that for you. And I think there's other occurences of this pattern in libxl as well. Wei. > Thanks and Regards, > Dario > > -- > <> (Raistlin Majere) > ----------------------------------------------------------------- > Dario Faggioli, Ph.D, http://about.me/dario.faggioli > Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) >