All of lore.kernel.org
 help / color / mirror / Atom feed
From: "wangyanan (Y)" <wangyanan55@huawei.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: Igor Mammedov <imammedo@redhat.com>,
	Andrew Jones <drjones@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 4/4] qemu-options: rewrite help for -smp options
Date: Mon, 28 Jun 2021 21:46:16 +0800	[thread overview]
Message-ID: <0fe6ae73-62f2-569b-1e9d-04bd7da7458a@huawei.com> (raw)
In-Reply-To: <20210628113047.462498-5-berrange@redhat.com>

Hi Daniel,

On 2021/6/28 19:30, Daniel P. Berrangé wrote:
> The -smp option help is peculiarly specific about mentioning the CPU
> upper limits, but these are wrong. The "PC" target has varying max
> CPU counts depending on the machine type picked. Notes about guest
> OS limits are inappropriate for QEMU docs. There are way too many
> machine types for it to be practical to mention actual limits, and
> some limits are even modified by downstream distribtions. Thus it
> is better to remove the specific limits entirely.
>
> The CPU topology reporting is also not neccessarily specific to the
> PC platform and descriptions around the rules of usage are somewhat
> terse. Expand this information with some examples to show effects
> of defaulting.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   qemu-options.hx | 29 +++++++++++++++++++++--------
>   1 file changed, 21 insertions(+), 8 deletions(-)
>
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 5871df7291..0021e9ec7b 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -207,14 +207,27 @@ DEF("smp", HAS_ARG, QEMU_OPTION_smp,
>           QEMU_ARCH_ALL)
>   SRST
>   ``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]``
> -    Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs
> -    are supported. On Sparc32 target, Linux limits the number of usable
> -    CPUs to 4. For the PC target, the number of cores per die, the
> -    number of threads per cores, the number of dies per packages and the
> -    total number of sockets can be specified. Missing values will be
> -    computed. If any on the three values is given, the total number of
> -    CPUs n can be omitted. maxcpus specifies the maximum number of
> -    hotpluggable CPUs.
> +    Simulate an SMP system with '\ ``n``\ ' CPUs initially present on
Should be "a SMP system".
> +    the machine type board. On boards supporting CPU hotplug, the optional
> +    '\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be
> +    added at runtime. If omitted the maximum number of CPUs will be
> +    set to match the initial CPU count. Both parameters are subject to
> +    an upper limit that is determined by the specific machine type chosen.
> +
> +    To control reporting of CPU topology information, the number of sockets,
> +    dies per socket, cores per die, and threads per core can be specified.
> +    The sum `` sockets * cores * dies * threads `` must be equal to the
> +    maximum CPU count. CPU targets may only support a subset of the topology
> +    parameters. Where a CPU target does not support use of a particular
> +    topology parameter, its value should be assumed to be 1 for the purpose
> +    of computing the CPU maximum count.
> +
Explicitly saying "sockets * dies * cores * threads" seems not 
arch-neutral at
first glance, although we have the explanation behind. How about the
following statement for this paragraph?

"
To control reporting of CPU topology information, at most the number of 
sockets,
dies per socket, cores per die, and threads per core can be specified. 
CPU targets
may only support a subset of the topology parameters. If a CPU target 
does not
support use of a particular topology parameter, it must not be 
specified. The sum
of the supported subset of parameters must be equal to the maximum CPU 
count.
"

I think this also make it easier to expand if we are going to add one 
more topology
parameter, e.g, cluster, in the future.
> +    Either the initial CPU count, or at least one of the topology parameters
> +    must be specified. Values for any omitted parameters will be computed
> +    from those which are given. Historically preference was given to the
> +    coarsest topology parameters when computing missing values (ie sockets
> +    preferred over cores, which were preferred over threads), however, this
> +    behaviour is considered liable to change.
>   ERST
>   
>   DEF("numa", HAS_ARG, QEMU_OPTION_numa,
Thanks,
Yanan
.


  reply	other threads:[~2021-06-28 13:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 11:30 [PATCH 0/4] docs: improve -smp documentation Daniel P. Berrangé
2021-06-28 11:30 ` [PATCH 1/4] docs: fix typo s/Intel/AMD/ in CPU model notes Daniel P. Berrangé
2021-06-28 13:52   ` wangyanan (Y)
2021-06-28 11:30 ` [PATCH 2/4] qemu-options: re-arrange CPU topology options Daniel P. Berrangé
2021-06-28 12:21   ` wangyanan (Y)
2021-07-12 10:10   ` Daniel P. Berrangé
2021-07-12 12:23     ` wangyanan (Y)
2021-07-12 13:09   ` Pankaj Gupta
2021-06-28 11:30 ` [PATCH 3/4] qemu-options: tweak to show that CPU count is optional Daniel P. Berrangé
2021-06-28 12:29   ` wangyanan (Y)
2021-06-28 11:30 ` [PATCH 4/4] qemu-options: rewrite help for -smp options Daniel P. Berrangé
2021-06-28 13:46   ` wangyanan (Y) [this message]
2021-07-09 14:15     ` Daniel P. Berrangé
2021-06-28 14:55 ` [PATCH 0/4] docs: improve -smp documentation Andrew Jones
2021-07-09 20:48 ` Eduardo Habkost
2021-07-13 13:22   ` Eduardo Habkost

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=0fe6ae73-62f2-569b-1e9d-04bd7da7458a@huawei.com \
    --to=wangyanan55@huawei.com \
    --cc=berrange@redhat.com \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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.