[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 03/14] machine: Uniformly use maxcpus to calculate the om
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v11 03/14] machine: Uniformly use maxcpus to calculate the omitted parameters |
Date: |
Tue, 28 Sep 2021 11:09:37 +0100 |
User-agent: |
Mutt/2.0.7 (2021-05-04) |
On Tue, Sep 28, 2021 at 11:57:44AM +0800, Yanan Wang wrote:
> We are currently using maxcpus to calculate the omitted sockets
> but using cpus to calculate the omitted cores/threads. This makes
> cmdlines like:
> -smp cpus=8,maxcpus=16
> -smp cpus=8,cores=4,maxcpus=16
> -smp cpus=8,threads=2,maxcpus=16
> work fine but the ones like:
> -smp cpus=8,sockets=2,maxcpus=16
> -smp cpus=8,sockets=2,cores=4,maxcpus=16
> -smp cpus=8,sockets=2,threads=2,maxcpus=16
> break the sanity check.
>
> Since we require for a valid config that the product of "sockets * cores
> * threads" should equal to the maxcpus, we should uniformly use maxcpus
> to calculate their omitted values.
>
> Also the if-branch of "cpus == 0 || sockets == 0" was split into two
> branches of "cpus == 0" and "sockets == 0" so that we can clearly read
> that we are parsing the configuration with a preference on cpus over
> sockets over cores over threads.
>
> Note: change in this patch won't affect any existing working cmdlines
> but improves consistency and allows more incomplete configs to be valid.
>
> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
> Reviewed-by: Andrew Jones <drjones@redhat.com>
> Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
> ---
> hw/core/machine.c | 30 +++++++++++++++---------------
> hw/i386/pc.c | 30 +++++++++++++++---------------
> 2 files changed, 30 insertions(+), 30 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- Re: [PATCH v11 05/14] machine: Improve the error reporting of smp parsing, (continued)
- [PATCH v11 07/14] qtest/numa-test: Use detailed -smp CLIs in test_def_cpu_split, Yanan Wang, 2021/09/27
- [PATCH v11 08/14] machine: Prefer cores over sockets in smp parsing since 6.2, Yanan Wang, 2021/09/27
- [PATCH v11 06/14] qtest/numa-test: Use detailed -smp CLIs in pc_dynamic_cpu_cfg, Yanan Wang, 2021/09/27
- [PATCH v11 03/14] machine: Uniformly use maxcpus to calculate the omitted parameters, Yanan Wang, 2021/09/27
- Re: [PATCH v11 03/14] machine: Uniformly use maxcpus to calculate the omitted parameters,
Daniel P . Berrangé <=
- [PATCH v11 09/14] machine: Use ms instead of global current_machine in sanity-check, Yanan Wang, 2021/09/27
- [PATCH v11 11/14] machine: Make smp_parse generic enough for all arches, Yanan Wang, 2021/09/27