From: Wei Liu Subject: Re: [PATCH v5 02/24] xen: make two memory hypercalls vNUMA-aware Date: Fri, 13 Feb 2015 13:24:53 +0000 Message-ID: <20150213132453.GZ13644@zion.uk.xensource.com> References: <1423770294-9779-1-git-send-email-wei.liu2@citrix.com> <1423770294-9779-3-git-send-email-wei.liu2@citrix.com> <54DDE75D.5060400@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <54DDE75D.5060400@citrix.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: Andrew Cooper Cc: Wei Liu , ian.campbell@citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, JBeulich@suse.com, ufimtseva@gmail.com List-Id: xen-devel@lists.xenproject.org On Fri, Feb 13, 2015 at 12:00:29PM +0000, Andrew Cooper wrote: [...] > > +static int translate_vnode_to_pnode(struct domain *d, > > + struct xen_memory_reservation *r, > > const struct xen_memory_reservation *r > Ack. > > + struct memop_args *a) > > +{ > > + int rc = 0; > > + unsigned int vnode, pnode; > > + > > + if ( r->mem_flags & XENMEMF_vnode ) > > + { > > + a->memflags &= ~MEMF_node(XENMEMF_get_node(r->mem_flags)); > > + a->memflags &= ~MEMF_exact_node; > > This interface feels semantically wrong, especially as the caller sets > these fields first, just to have them dropped at this point. > > A rather more appropriate function would be something along the lines of > "construct_memop_from_reservation()" (name subject to improvement) which > takes care completely filling 'a' from 'r', doing a v->p translation if > needed. > I'm fine with this. I'm going to use construct_memop_from_reservation if no better alternative emerges. Wei.