Skip to contentSkip to conversation

xen: cpupools: update domU's node-affinity on the cpupool_unassign_cpu() path

PATCH In review Dario Faggioli 2 participants 2 messages Sep 27, 2013 – Sep 30, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: cpupools: update domU's node-affinity on the cpupool_unassign_cpu() path

that is, when a cpu is remove from a pool, as it is happening already on the cpupool_assign_cpu_*() path (i.e., when a cpu is added to a pool).

Cc Juergen Gross <[email protected]>
Cc George Dunlap <[email protected]>
Cc Keir Fraser <[email protected]>

---
This patch was originally an hunk of the first version of a patch I sent last week as a bugfix for an ASSERT() triggering in the NUMA-aware scheduling code.

Truned out that the bug was better fixe in a completely different way, and hence this part was killed from there... That's why I'm resending it now as a separate patch.

Dario

---
 xen/common/cpupool.c |    8 ++++++++
 1 file changed, 8 insertions(+)
xen/common/cpupool.c +8 -0
index 2164a9f..23e461d 100644
@@ -355,6 +355,14 @@ int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu)
     atomic_inc(&c->refcnt);
     cpupool_cpu_moving = c;
     cpumask_clear_cpu(cpu, c->cpu_valid);
+
+    rcu_read_lock(&domlist_read_lock);
+    for_each_domain_in_cpupool(d, c)
+    {
+        domain_update_node_affinity(d);
+    }
+    rcu_read_unlock(&domlist_read_lock);
+
     spin_unlock(&cpupool_lock);
 
     work_cpu = smp_processor_id();
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Dario Faggioli

that is, when a cpu is remove from a pool, as it is happening already on the cpupool_assign_cpu_*() path (i.e., when a cpu is added to a pool).

Cc Juergen Gross <[email protected]>
Cc George Dunlap <[email protected]>
Cc Keir Fraser <[email protected]>
Quoted 40 lines

---
This patch was originally an hunk of the first version of a patch I sent last week as a bugfix for an ASSERT() triggering in the NUMA-aware scheduling code.

Truned out that the bug was better fixe in a completely different way, and hence this part was killed from there... That's why I'm resending it now as a separate patch.

Dario

---
  xen/common/cpupool.c |    8 ++++++++
  1 file changed, 8 insertions(+)
xen/common/cpupool.c +8 -0
index 2164a9f..23e461d 100644
@@ -355,6 +355,14 @@ int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu)
      atomic_inc(&c->refcnt);
      cpupool_cpu_moving = c;
      cpumask_clear_cpu(cpu, c->cpu_valid);
+
+    rcu_read_lock(&domlist_read_lock);
+    for_each_domain_in_cpupool(d, c)
+    {
+        domain_update_node_affinity(d);
+    }
+    rcu_read_unlock(&domlist_read_lock);
+
      spin_unlock(&cpupool_lock);
 
      work_cpu = smp_processor_id();

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Signature · 5 lines
Juergen Gross                 Principal Developer Operating Systems
PBG PDG ES&S SWE OS6                   Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: [email protected]
Mies van der Rohe Str. 8                Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html