From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [v7 PATCH 03/10] xen: derive NUMA node affinity from hard and soft CPU affinity Date: Tue, 10 Jun 2014 15:53:03 +0100 Message-ID: <53971BCF.1090608@eu.citrix.com> References: <20140610002959.16660.44334.stgit@Solace> <20140610004443.16660.61987.stgit@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140610004443.16660.61987.stgit@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 , xen-devel@lists.xen.org Cc: keir@xen.org, Ian.Campbell@citrix.com, Andrew.Cooper3@citrix.com, George.Dunlap@citrix.com, JBeulich@suse.com, Ian.Jackson@citrix.com List-Id: xen-devel@lists.xenproject.org On 06/10/2014 01:44 AM, Dario Faggioli wrote: > if a domain's NUMA node-affinity (which is what controls > memory allocations) is provided by the user/toolstack, it > just is not touched. However, if the user does not say > anything, leaving it all to Xen, let's compute it in the > following way: > > 1. cpupool's cpus & hard-affinity & soft-affinity > 2. if (1) is empty: cpupool's cpus & hard-affinity > > This guarantees memory to be allocated from the narrowest > possible set of NUMA nodes, ad makes it relatively easy to > set up NUMA-aware scheduling on top of soft affinity. > > Note that such 'narrowest set' is guaranteed to be non-empty. > > Signed-off-by: Dario Faggioli > Reviewed-by: George Dunlap > Acked-by: Jan Beulich > --- > Chenges from v6: > * fixed a bug when a domain was being created inside a > cpupool; This definitely should have erased the Reviewed-by, as it implies I reviewed the bug fix. > * coding style. > > Changes from v3: > * avoid pointless calls to cpumask_clear(), as requested > during review; > * ASSERT() non emptyness of cpupool & hard affinity, as > suggested during review. > > Changes from v2: > * the loop computing the mask is now only executed when > it really is useful, as suggested during review; > * the loop, and all the cpumask handling is optimized, > in a way similar to what was suggested during review. > --- > xen/common/domain.c | 61 +++++++++++++++++++++++++++++++------------------ > xen/common/schedule.c | 4 ++- > 2 files changed, 42 insertions(+), 23 deletions(-) > > diff --git a/xen/common/domain.c b/xen/common/domain.c > index e20d3bf..c3a576e 100644 > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -409,17 +409,17 @@ struct domain *domain_create( > > void domain_update_node_affinity(struct domain *d) > { > - cpumask_var_t cpumask; > - cpumask_var_t online_affinity; > + cpumask_var_t dom_cpumask, dom_cpumask_soft; > + cpumask_t *dom_affinity; Also, just curious, did you rename these variables since the last series? Acked-by: George Dunlap