qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Lan Tianyu <tianyu.lan@intel.com>,
	"Daniel P. Berrange" <berrange@redhat.com>,
	pbonzini@redhat.com, mst@redhat.com, qemu-devel@nongnu.org,
	rth@twiddle.net, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] x86: Increase max vcpu number to 352
Date: Thu, 10 Aug 2017 21:22:08 +0200	[thread overview]
Message-ID: <20170810192207.GA22459@flask> (raw)
In-Reply-To: <20170810181648.GC3108@localhost.localdomain>

2017-08-10 15:16-0300, Eduardo Habkost:
> On Thu, Aug 10, 2017 at 02:41:03PM +0200, Radim Krčmář wrote:
> > 2017-08-10 19:02+0800, Lan Tianyu:
> > > On 2017年08月10日 18:26, Daniel P. Berrange wrote:
> > >> On Thu, Aug 10, 2017 at 06:08:07PM +0800, Lan Tianyu wrote:
> > >>> Intel Xeon phi chip will support 352 logical threads. For HPC
> > >>> usage case, it will create a huge VM with vcpus number as same as host
> > >>> cpus. This patch is to increase max vcpu number to 352.
> > >> 
> > >> If we pick arbitray limits based on size of physical CPUs that happen
> > >> to be shipping today, we'll continue the cat+mouse game forever trailing
> > >> latest CPUs that vendors ship.
> > >> 
> > >> IMHO we should pick a higher number influenced by technical constraints
> > >> of the q35 impl instead. eg can we go straight to something like 512 or
> > >> 1024  ?
> > > 
> > > Sure. 512 should be enough and some arrays is defined according to max
> > > vcpu number.
> > 
> > Hm, which arrays are that?  I was thinking it is safe to bump it to
> > INT_MAX as the number is only used when setting global max_cpus.
> 
> We had a MAX_CPUMASK_BITS macro, and bitmaps whose sizes were
> defined at compile time based on it.  But commit
> cdda2018e3b9ce0c18938767dfdb1e05a05b67ca removed it.  Probably
> those arrays all use max_cpus, by now (and the default for
> max_cpus is smp_cpus, not MachineClass::max_cpus).

Ah, thanks.

> Anyway, if we set it to INT_MAX, there are some cases where more
> appropriate error checking/reporting could be required because
> they won't handle overflow very well:
> * pcms->apic_id_limit initialization at pc_cpus_init()
> * ACPI code that assumes possible_cpus->cpus[i].arch_id fits
>   in a 32-bit integer
> * Other x86_cpu_apic_id_from_index() calls in PC code
>   (especially the initialization of possible_cpus->cpus[i].arch_id).
>   Note that x86_cpu_apic_id_from_index(cpu_index) might not fit
>   in 32 bits even if cpu_index <= UINT32_MAX.

Good point, looks like it all comes to x86_cpu_apic_id_from_index().
Each level of the topology has at most one underutilized bit, so
2^(32 - 3) would be safe.

It is still needlessly large for the foreseeable future, but 512 is
going to be surpassed pretty soon, so I think that jumping at least to
8k would be better.
(8k the current default maximum for Linux and the resulting overcommit
 of ~20 is bearable for smoke testing on current hardware.)

  reply	other threads:[~2017-08-10 19:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 10:08 [Qemu-devel] [PATCH] x86: Increase max vcpu number to 352 Lan Tianyu
2017-08-10 10:26 ` Daniel P. Berrange
2017-08-10 11:02   ` Lan Tianyu
2017-08-10 12:41     ` Radim Krčmář
2017-08-10 18:16       ` Eduardo Habkost
2017-08-10 19:22         ` Radim Krčmář [this message]
2017-08-11  6:07           ` Lan Tianyu
2017-08-10 12:13 ` Paolo Bonzini
2017-08-10 13:52   ` Daniel P. Berrange
  -- strict thread matches above, loose matches on Subject: below --
2017-08-10  3:58 Lan Tianyu
2017-08-10 18:08 ` Konrad Rzeszutek Wilk
2017-08-11 11:51   ` 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=20170810192207.GA22459@flask \
    --to=rkrcmar@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=tianyu.lan@intel.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 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).