[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RESEND v7 6/9] libxl: build numa nodes memory blocks
On Thu, Aug 21, 2014 at 10:18:00PM -0400, Konrad Rzeszutek Wilk wrote: [...] > > +bool libxl__vnodemap_is_usable(libxl__gc *gc, > > + libxl_domain_build_info *info) > > +{ > > + unsigned int i; > > + libxl_numainfo *ninfo = NULL; > > + unsigned long long *claim; > > + unsigned int node; > > + uint64_t *sz_array; > > + int nr_nodes = 0; > > + > > + /* Cannot use specified mapping if not NUMA machine. */ > > + ninfo = libxl_get_numainfo(CTX, &nr_nodes); > > + if (ninfo == NULL) > > + return false; > > + > > + sz_array = info->vnuma_mem; > > + claim = libxl__calloc(gc, info->vnodes, sizeof(*claim)); > > + /* Get total memory required on each physical node. */ > > + for (i = 0; i < info->vnodes; i++) > > + { > > + node = info->vnuma_vnodemap[i]; > > + > > + if (node < nr_nodes) > > + claim[node] += (sz_array[i] << 20); > > + else > > + goto vnodemapout; > > + } > > + for (i = 0; i < nr_nodes; i++) { > > + if (claim[i] > ninfo[i].free) > > + /* Cannot complete user request, falling to default. */ > > + goto vnodemapout; > > + } > > + > > + vnodemapout: > > Shouldn't we free 'claim' ? I think not. It's managed by gc. Wei. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |