All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Alexander Graf <agraf@suse.de>, Rob Herring <robh@kernel.org>,
	libvir-list@redhat.com, Richard Henderson <rth@twiddle.net>,
	Eric Blake <eblake@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	qemu-arm@nongnu.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Markus Armbruster <armbru@redhat.com>,
	Artyom Tarasenko <atar4qemu@gmail.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Michael Walle <michael@walle.cc>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Aleksandar Markovic <amarkovic@wavecomp.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Alistair Francis <alistair@alistair23.me>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	qemu-ppc@nongnu.org,
	Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
	Max Filippov <jcmvbkbc@gmail.com>
Subject: Re: [Qemu-devel] [PULL 03/45] vl:c: make sure that sockets are calculated correctly in '-smp X' case
Date: Tue, 23 Oct 2018 16:06:24 +0100	[thread overview]
Message-ID: <20181023150624.GB12127@umbus.hotspot.internet-for-guests.com> (raw)
In-Reply-To: <20181018200422.4358-4-ehabkost@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2337 bytes --]

On Thu, Oct 18, 2018 at 05:03:40PM -0300, Eduardo Habkost wrote:
> From: Igor Mammedov <imammedo@redhat.com>
> 
> commit
>   (5cdc9b76e3 vl.c: Remove dead assignment)
> removed sockets calculation when 'sockets' weren't provided on CLI
> since there wasn't any users for it back then. Exiting checks
> are neither reachable
>    } else if (sockets * cores * threads < cpus) {
> or nor triggerable
>    if (sockets * cores * threads > max_cpus)
> so we weren't noticing wrong topology since then, since users
> recalculate sockets adhoc on their own.
> 
> However with deprecation check it becomes noticable, for example
>   -smp 2
> will start printing warning:
>   "warning: Invalid CPU topology deprecated: sockets (1) * cores (1) * threads (1) != maxcpus (2)"
> calculating sockets if they weren't specified.
> 
> Fix it by returning back sockets calculation if it's omitted on CLI.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> Reviewed-by: Andrew Jones <drjones@redhat.com>
> Message-Id: <1536836762-273036-3-git-send-email-imammedo@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  vl.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/vl.c b/vl.c
> index 027d04c7ca..2324321d91 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1199,11 +1199,14 @@ static void smp_parse(QemuOpts *opts)
>  
>          /* compute missing values, prefer sockets over cores over threads */
>          if (cpus == 0 || sockets == 0) {
> -            sockets = sockets > 0 ? sockets : 1;
>              cores = cores > 0 ? cores : 1;
>              threads = threads > 0 ? threads : 1;
>              if (cpus == 0) {
> +                sockets = sockets > 0 ? sockets : 1;
>                  cpus = cores * threads * sockets;
> +            } else {
> +                max_cpus = qemu_opt_get_number(opts, "maxcpus", cpus);
> +                sockets = max_cpus / (cores * threads);
>              }
>          } else if (cores == 0) {
>              threads = threads > 0 ? threads : 1;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-10-23 15:34 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 20:03 [Qemu-devel] [PULL 00/45] Machine queue, 2018-10-18 Eduardo Habkost
2018-10-18 20:03 ` [Qemu-devel] [PULL 01/45] hostmem-file: fixed the memory leak while get pmem path Eduardo Habkost
2018-10-21 17:37   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 02/45] vl.c deprecate incorrect CPUs topology Eduardo Habkost
2018-10-21 17:38   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 03/45] vl:c: make sure that sockets are calculated correctly in '-smp X' case Eduardo Habkost
2018-10-23 15:06   ` David Gibson [this message]
2018-10-18 20:03 ` [Qemu-devel] [PULL 04/45] numa: Fix QMP command set-numa-node error handling Eduardo Habkost
2018-10-23 15:07   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 05/45] trace-events: Fix copy/paste typo Eduardo Habkost
2018-10-23 15:08   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 06/45] hw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events Eduardo Habkost
2018-10-23 15:09   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 07/45] hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init Eduardo Habkost
2018-10-23 15:10   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 08/45] hw/ssi/xilinx_spi: " Eduardo Habkost
2018-10-23 15:11   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 09/45] hw/sh4/sh_pci: " Eduardo Habkost
2018-10-23 15:12   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 10/45] hw/pci-host/bonito: " Eduardo Habkost
2018-10-23 15:14   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 11/45] hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device reset method Eduardo Habkost
2018-10-18 20:03 ` [Qemu-devel] [PULL 12/45] hw/mips/gt64xxx_pci: Mark as bridge device Eduardo Habkost
2018-10-23 15:16   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 13/45] hw/sparc64/niagara: Model the I/O Bridge with the 'unimplemented_device' Eduardo Habkost
2018-10-18 20:03 ` [Qemu-devel] [PULL 14/45] hw/alpha/typhoon: Remove unuseful code Eduardo Habkost
2018-10-23 15:18   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 15/45] hw/hppa/dino: " Eduardo Habkost
2018-10-23 15:18   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 16/45] hw/mips/malta: " Eduardo Habkost
2018-10-23 15:19   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 17/45] machine: fix a typo Eduardo Habkost
2018-10-23 15:20   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 18/45] memory-device: fix alignment error message Eduardo Habkost
2018-10-23 15:20   ` David Gibson
2018-10-18 20:03 ` [Qemu-devel] [PULL 19/45] memory-device: fix error message when hinted address is too small Eduardo Habkost
2018-10-18 20:03 ` [Qemu-devel] [PULL 20/45] memory-device: improve "range conflicts" error message Eduardo Habkost
2018-10-18 20:03 ` [Qemu-devel] [PULL 21/45] pc-dimm: pass PCDIMMDevice to pc_dimm_.*plug Eduardo Habkost
2018-10-18 20:03 ` [Qemu-devel] [PULL 22/45] memory-device: use memory device terminology in error messages Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 23/45] memory-device: introduce separate config option Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 24/45] memory-device: forward errors in get_region_size()/get_plugged_size() Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 25/45] memory-device: document MemoryDeviceClass Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 26/45] memory-device: add and use memory_device_get_region_size() Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 27/45] memory-device: factor out get_memory_region() from pc-dimm Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 28/45] memory-device: drop get_region_size() Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 29/45] memory-device: add device class function set_addr() Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 30/45] memory-device: complete factoring out pre_plug handling Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 31/45] memory-device: complete factoring out plug handling Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 32/45] memory-device: complete factoring out unplug handling Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 33/45] memory-device: trace when pre_plugging/plugging/unplugging Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 34/45] net: etraxfs_eth: convert SysBus init method to a realize method Eduardo Habkost
2018-10-23 15:22   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 35/45] net: etraxfs_eth: add a reset method Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 36/45] net: lan9118: convert SysBus init method to a realize method Eduardo Habkost
2018-10-23 15:23   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 37/45] net: lance: " Eduardo Habkost
2018-10-23 15:24   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 38/45] net: milkymist_minimac2: " Eduardo Habkost
2018-10-23 15:24   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 39/45] net: mipsnet: " Eduardo Habkost
2018-10-23 15:25   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 40/45] net: opencores_eth: " Eduardo Habkost
2018-10-23 15:25   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 41/45] net: smc91c111: " Eduardo Habkost
2018-10-23 15:25   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 42/45] net: stellaris_enet: " Eduardo Habkost
2018-10-23 15:26   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 43/45] net: stellaris_enet: add a reset method Eduardo Habkost
2018-10-18 20:04 ` [Qemu-devel] [PULL 44/45] net: xgmac: convert SysBus init method to a realize method Eduardo Habkost
2018-10-23 15:26   ` David Gibson
2018-10-18 20:04 ` [Qemu-devel] [PULL 45/45] numa: Clean up error reporting in parse_numa() Eduardo Habkost
2018-10-23 15:27   ` David Gibson
2018-10-19 14:12 ` [Qemu-devel] [PULL 00/45] Machine queue, 2018-10-18 Peter Maydell
2018-10-19 17:00   ` Philippe Mathieu-Daudé
2018-10-19 17:55     ` Philippe Mathieu-Daudé
2018-10-19 18:44   ` Eduardo Habkost
2018-10-19 19:53     ` Igor Mammedov
2018-10-19 20:23       ` Eduardo Habkost
2018-10-20 10:27         ` Philippe Mathieu-Daudé
2018-10-22  9:00         ` Igor Mammedov
2018-10-22 15:02           ` Markus Armbruster

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=20181023150624.GB12127@umbus.hotspot.internet-for-guests.com \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=alistair@alistair23.me \
    --cc=amarkovic@wavecomp.com \
    --cc=armbru@redhat.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=eblake@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=libvir-list@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=michael@walle.cc \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=robh@kernel.org \
    --cc=rth@twiddle.net \
    --cc=xiaoguangrong.eric@gmail.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.