From: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] smp-parse: smp-opt-cores for simple -smp X
Date: Fri, 8 Jul 2011 21:59:50 +0200 [thread overview]
Message-ID: <20110708195950.GA23040@os.inf.tu-dresden.de> (raw)
Hi,
When just using a simple '-smp X', both the smp_cores and smp_threads
variables are set to 1, which on x86 leads to CPUid-0x80000008-ecx
returning 1 for the CPU count despite more CPUs are there. Docs say
'Missing values will be computed.', so my try on this is the following.
Comments?
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
---
vl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/vl.c b/vl.c
index fcd7395..1459bde 100644
--- a/vl.c
+++ b/vl.c
@@ -886,6 +886,8 @@ static void smp_parse(const char *optarg)
max_cpus = strtoull(option, NULL, 10);
/* compute missing values, prefer sockets over cores over threads */
+ if (sockets + cores + threads == 0)
+ cores = smp;
if (smp == 0 || sockets == 0) {
sockets = sockets > 0 ? sockets : 1;
cores = cores > 0 ? cores : 1;
--
1.7.5.3
Adam
--
Adam adam@os.inf.tu-dresden.de
Lackorzynski http://os.inf.tu-dresden.de/~adam/
reply other threads:[~2011-07-08 19:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20110708195950.GA23040@os.inf.tu-dresden.de \
--to=adam@os.inf.tu-dresden.de \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).