From: Ian Campbell Subject: Re: [PATCH] Reflect cpupool in numa node affinity Date: Mon, 23 Jan 2012 11:03:15 +0000 Message-ID: <1327316595.24561.44.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Juergen Gross Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-01-23 at 09:51 +0000, Juergen Gross wrote: > @@ -365,15 +366,21 @@ void domain_update_node_affinity(struct > void domain_update_node_affinity(struct domain *d) > { > cpumask_t cpumask; > + cpumask_t online_affinity; > + cpumask_t *online; > nodemask_t nodemask = NODE_MASK_NONE; > struct vcpu *v; > unsigned int node; > > + online = (d->cpupool == NULL) ? &cpu_online_map : d->cpupool->cpu_valid; > cpumask_clear(&cpumask); > spin_lock(&d->node_affinity_lock); > > for_each_vcpu ( d, v ) > - cpumask_or(&cpumask, &cpumask, v->cpu_affinity); > + { > + cpumask_and(&online_affinity, v->cpu_affinity, online); > + cpumask_or(&cpumask, &cpumask, &online_affinity); > + } > > for_each_online_node ( node ) > if ( cpumask_intersects(&node_to_cpumask(node), &cpumask) ) Is there any possibility that the addition of the cpumask_and clause could result in the empty set? Ian.