From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
Subject: x86/dom0: limit dom0_max_vcpus value
Date: Mon, 12 Mar 2012 15:56:21 +0000 [thread overview]
Message-ID: <4F5E1CA5.1060103@citrix.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 272 bytes --]
This caused particularly poor performance when booting a server in
uniprocessor mode for debugging reasons, and had 4 dom0 vcpus competing
for 1pcpus worth of time.
--
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com
[-- Attachment #2: limit-dom_max_vcpus.patch --]
[-- Type: text/x-patch, Size: 1413 bytes --]
# HG changeset patch
# Parent 5d20d2f6ffed0a49f030f04a8870f1926babbcbf
x86/dom0: limit dom0_max_vcpus value
The command line parameter "dom0_max_vcpus" is useful on large servers where
dom0 does not want many vcpus, as an alternative to booting and hot-unplugging
down to a sensible number (which is poor memory-wize as many drivers allocate
large per-cpu buffers which will never be used after the hot-unplug).
However, as the code currently stands, the value for "dom0_max_vcpus" is used as
an absolute value rather than a maximum, resulting in dom0 getting more vcpus
than pcpus. This can lead to unexpected poor performance.
Therefore, augment the "opt_dom0_max_vcpus == 0" test to also check whether the
user specified parameter is greater than the number of available pcpus.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff -r 5d20d2f6ffed xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -87,8 +87,9 @@ integer_param("dom0_max_vcpus", opt_dom0
struct vcpu *__init alloc_dom0_vcpu0(void)
{
- if ( opt_dom0_max_vcpus == 0 )
- opt_dom0_max_vcpus = num_cpupool_cpus(cpupool0);
+ int nr_pcpus = num_cpupool_cpus(cpupool0);
+ if ( opt_dom0_max_vcpus == 0 || opt_dom0_max_vcpus > nr_pcpus)
+ opt_dom0_max_vcpus = nr_pcpus;
if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
opt_dom0_max_vcpus = MAX_VIRT_CPUS;
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next reply other threads:[~2012-03-12 15:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-12 15:56 Andrew Cooper [this message]
2012-03-12 16:12 ` x86/dom0: limit dom0_max_vcpus value Jan Beulich
2012-03-12 16:32 ` Andrew Cooper
2012-03-12 16:41 ` Jan Beulich
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=4F5E1CA5.1060103@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xensource.com \
/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.