All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: David Matlack <dmatlack@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Kyle Meyer <kyle.meyer@hpe.com>, kvm list <kvm@vger.kernel.org>,
	X86 ML <x86@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	russ.anderson@hpe.com, payton@hpe.com,
	"H. Peter Anvin" <hpa@zytor.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Wanpeng Li <wanpengli@tencent.com>
Subject: Re: [PATCH] KVM: x86: Increase KVM_MAX_VCPUS to 2048
Date: Thu, 16 Jun 2022 16:58:43 +0000	[thread overview]
Message-ID: <YqthQ6QmK43ZPfkM@google.com> (raw)
In-Reply-To: <CALzav=fjvO0csAV5onsdXijDnvYJNMccoNHKPiraU6tHhCURuQ@mail.gmail.com>

On Thu, Jun 16, 2022, David Matlack wrote:
> On Tue, Jun 14, 2022 at 1:28 AM Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
> >
> > David Matlack <dmatlack@google.com> writes:
> >
> > > On Mon, Jun 13, 2022 at 11:35 AM Kyle Meyer <kyle.meyer@hpe.com> wrote:
> > >>
> > >> Increase KVM_MAX_VCPUS to 2048 so we can run larger virtual machines.
> > >
> > > Does the host machine have 2048 CPUs (or more) as well in your usecase?
> > >
> > > I'm wondering if it makes sense to start configuring KVM_MAX_VCPUS
> > > based on NR_CPUS. That way KVM can scale up on large machines without
> > > using more memory on small machines.
> > >
> > > e.g.
> > >
> > > /* Provide backwards compatibility. */
> > > #if NR_CPUS < 1024
> > >   #define KVM_MAX_VCPUS 1024
> > > #else
> > >   #define KVM_MAX_VCPUS NR_CPUS
> > > #endif
> > >
> > > The only downside I can see for this approach is if you are trying to
> > > kick the tires a new large VM on a smaller host because the new "large
> > > host" hardware hasn't landed yet.
> 
> Heh. My point here doesn't make sense. The actual number of CPUs in
> the host machine wouldn't matter, just the host kernel's NR_CPUS.
> 
> >
> > FWIW, while I don't think there's anything wrong with such approach, it
> > won't help much distro kernels which are not recompiled to meet the
> > needs of a particular host.
> 
> But is there a use-case for running a VM with more vCPUs than the
> kernel's NR_CPUS?

With custom configs yes, e.g. my host kernel config for my anemic old system has
CONFIG_NR_CPUS=12 and I occasionally run VMs with >12 vCPUs for testing purposes.

But that obviously doesn't apply if KVM_MAX_VCPUS has a lower bound of 1024, so
I agree that making KVM_MAX_VCPUS=max(1024, NR_CPUS) should do just fine.

  reply	other threads:[~2022-06-16 16:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13 14:50 [PATCH] KVM: x86: Increase KVM_MAX_VCPUS to 2048 Kyle Meyer
2022-06-13 15:19 ` Vitaly Kuznetsov
2022-06-13 20:24 ` David Matlack
2022-06-14  8:27   ` Vitaly Kuznetsov
2022-06-16 16:47     ` David Matlack
2022-06-16 16:58       ` Sean Christopherson [this message]
2022-06-29 20:38         ` [PATCH v2] KVM: x86: Increase KVM_MAX_VCPUS to 4096 Kyle Meyer
2022-06-30  8:09           ` Vitaly Kuznetsov
2022-07-07 17:03             ` Sean Christopherson
2022-06-14 13:14 [PATCH] KVM: x86: Increase KVM_MAX_VCPUS to 2048 Meyer, Kyle

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=YqthQ6QmK43ZPfkM@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dmatlack@google.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=kyle.meyer@hpe.com \
    --cc=mingo@redhat.com \
    --cc=payton@hpe.com \
    --cc=russ.anderson@hpe.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.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.