From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: [PATCH] xen: cpupools: update domU's node-affinity on the cpupool_unassign_cpu() path Date: Fri, 27 Sep 2013 17:46:15 +0200 Message-ID: <20130927154610.26755.4179.stgit@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VPaFH-0004Yu-CM for xen-devel@lists.xenproject.org; Fri, 27 Sep 2013 15:46:19 +0000 Received: by mail-ea0-f182.google.com with SMTP id o10so1302387eaj.13 for ; Fri, 27 Sep 2013 08:46:17 -0700 (PDT) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: George Dunlap , Juergen Gross , Keir Fraser List-Id: xen-devel@lists.xenproject.org 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). Signed-off-by: Dario Faggioli Cc: Juergen Gross Cc: George Dunlap Cc: Keir Fraser --- 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(+) diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index 2164a9f..23e461d 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -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();