From: Dario Faggioli <dario.faggioli@citrix.com>
To: George Dunlap <George.Dunlap@citrix.com>
Cc: "JGross@suse.com" <JGross@suse.com>,
"keir.xen@gmail.com" <keir.xen@gmail.com>,
"jtweaver@hawaii.edu" <jtweaver@hawaii.edu>,
"JBeulich@suse.com" <JBeulich@suse.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [PATCH] xen: avoid updating node affinity twice when removing a CPU from a cpupool
Date: Thu, 12 Mar 2015 13:45:25 +0000 [thread overview]
Message-ID: <1426167922.7023.21.camel@citrix.com> (raw)
In-Reply-To: <1426089874.21405.10.camel@citrix.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 2231 bytes --]
On Wed, 2015-03-11 at 16:04 +0000, Dario Faggioli wrote:
> On Wed, 2015-03-11 at 15:01 +0000, George Dunlap wrote:
> > It looks like domain_update_node_affinity() is already called for each
> > domain in the cpupool in cpu_disable_scheduler(). It doesn't look like
> > there should be a need to call it twice. Can we just remove the call to
> > domain_update_node_affinity() in cpupool_unassign_cpu() and not add it back?
> >
> Mmm.. true, actually.
>
> I'll send a patch to that effect.
>
Patch below, and attached. However, I think the correct thing to do
would be to just revert 93be8285 "update domU's node-affinity on the
cpupool_unassign_cpu() path", wouldn't it?
Regards,
Dario
8-------------------------------------------------------------------
xen: avoid updating node affinity twice when removing a CPU from a cpupool
93be8285 ("update domU's node-affinity on the cpupool_unassign_cpu()
path") introduced a call to domain_update_node_affinity() when a
pCPU is removed from a cpupool, but that happens already, in
cpu_disable_scheduler().
Furthermore, it causes (although only in rather awkward
circumstances), the following ASSERT to trigger:
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Assertion '!cpumask_empty(dom_cpumask)' failed at domain.c:460
(XEN) ****************************************
This change, therefore, undo that.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Juergen Gross <JGross@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir.xen@gmail.com>
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index a758a8b..cd6aab9 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -379,12 +379,6 @@ static 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();
[-- Attachment #1.1.2: xen-fix-cpupool-unassign-cpu.patch --]
[-- Type: text/x-patch, Size: 1409 bytes --]
xen: avoid updating node affinity twice when removing a CPU from a cpupool
93be8285 ("update domU's node-affinity on the cpupool_unassign_cpu()
path") introduced a call to domain_update_node_affinity() when a
pCPU is removed from a cpupool, but that happens already, in
cpu_disable_scheduler().
Furthermore, it causes (although only in rather awkward
circumstances), the following ASSERT to trigger:
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Assertion '!cpumask_empty(dom_cpumask)' failed at domain.c:460
(XEN) ****************************************
This change, therefore, undo that.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Juergen Gross <JGross@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir.xen@gmail.com>
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index a758a8b..cd6aab9 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -379,12 +379,6 @@ static 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();
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-03-12 13:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-09 16:49 [PATCH] xen: postpone updating domains' node affinity when removing a CPU from a cpupool Dario Faggioli
2015-03-11 10:32 ` Dario Faggioli
2015-03-11 15:01 ` George Dunlap
2015-03-11 16:04 ` Dario Faggioli
2015-03-12 13:45 ` Dario Faggioli [this message]
2015-03-12 14:51 ` [PATCH] xen: avoid updating node affinity twice " Jan Beulich
2015-03-12 15:52 ` Dario Faggioli
2015-03-13 11:15 ` George Dunlap
2015-03-12 14:52 ` George Dunlap
2015-03-12 15:56 ` Dario Faggioli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1426167922.7023.21.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=George.Dunlap@citrix.com \
--cc=JBeulich@suse.com \
--cc=JGross@suse.com \
--cc=jtweaver@hawaii.edu \
--cc=keir.xen@gmail.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.