From: Wei Liu Subject: Re: [PATCH v6 08/10] libxl: build numa nodes memory blocks Date: Fri, 18 Jul 2014 12:01:56 +0100 Message-ID: <20140718110156.GF7142@zion.uk.xensource.com> References: <1405662609-31486-1-git-send-email-ufimtseva@gmail.com> <1405662609-31486-9-git-send-email-ufimtseva@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1405662609-31486-9-git-send-email-ufimtseva@gmail.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: Elena Ufimtseva Cc: keir@xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, msw@linux.com, dario.faggioli@citrix.com, lccycc123@gmail.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, JBeulich@suse.com, wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, Jul 18, 2014 at 01:50:07AM -0400, Elena Ufimtseva wrote: [...] > > +bool libxl__vnodemap_is_usable(libxl__gc *gc, libxl_domain_build_info *info); > + > +int e820_sanitize(libxl_ctx *ctx, struct e820entry src[], > + uint32_t *nr_entries, > + unsigned long map_limitkb, > + unsigned long balloon_kb); > + e820_sanitize should not take a ctx? It's internal function anyway. But this is not your fault so don't worry about it. And this function seems to be arch-specific so I wonder if there's better place for it. > +int libxl__vnuma_align_mem(libxl__gc *gc, > + uint32_t domid, > + struct libxl_domain_build_info *b_info, > + vmemrange_t *memblks); > + Indentation. > +/* > + * For each node, build memory block start and end addresses. > + * Substract any memory hole from the range found in e820 map. > + * vnode memory size are passed here in megabytes, the result is > + * in memory block addresses. > + * Linux kernel will adjust numa memory block sizes on its own. > + * But we want to provide to the kernel numa block addresses that > + * will be the same in kernel and hypervisor. > + */ > +#define max(a,b) ((a > b) ? a : b) You won't need to redefine max, I think we have this somewhere already. (Haven't looked into the placement strategy, I guess you, Dario and George have come to agreement on how this should be implemented) Wei.