switch to dynamically allocated cpumask in domain_update_node_affinity()

cpumasks should rather be allocated dynamically.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
This commit is contained in:
Juergen Gross committed 2012-01-24 14:20:40 +00:00
1 parent 9b80635f9d
commit 79cf2c4c4f
1 file changed
+9 -4
+9 -4
View File
@@ -220,6 +220,7 @@ struct domain *domain_create(
INIT_PAGE_LIST_HEAD(&d->xenpage_list);
spin_lock_init(&d->node_affinity_lock);
d->node_affinity = NODE_MASK_ALL;
spin_lock_init(&d->shutdown_lock);
d->shutdown_code = -1;
@@ -333,23 +334,27 @@ struct domain *domain_create(
void domain_update_node_affinity(struct domain *d)
{
cpumask_t cpumask;
cpumask_var_t cpumask;
nodemask_t nodemask = NODE_MASK_NONE;
struct vcpu *v;
unsigned int node;
cpumask_clear(&cpumask);
if ( !zalloc_cpumask_var(&cpumask) )
return;
spin_lock(&d->node_affinity_lock);
for_each_vcpu ( d, v )
cpumask_or(&cpumask, &cpumask, v->cpu_affinity);
cpumask_or(cpumask, cpumask, v->cpu_affinity);
for_each_online_node ( node )
if ( cpumask_intersects(&node_to_cpumask(node), &cpumask) )
if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
node_set(node, nodemask);
d->node_affinity = nodemask;
spin_unlock(&d->node_affinity_lock);
free_cpumask_var(cpumask);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.