qemu-devel
[Top][All Lists]
Advanced

[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 :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]