public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: kconfig does not accept a lower value for KVM_MAX_NR_VCPUS
       [not found] <03a04e86-c629-44df-9022-05c42b4c736f@gmx.de>
@ 2025-01-19 23:55 ` Bagas Sanjaya
  2025-01-21 15:55   ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Bagas Sanjaya @ 2025-01-19 23:55 UTC (permalink / raw)
  To: Toralf Förster, Linux Kernel Mailing List, Linux KVM
  Cc: Sean Christopherson, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin

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

On Sun, Jan 19, 2025 at 12:04:04PM +0100, Toralf Förster wrote:
> I was wondering why I cannot put a lower value here during make oldconfig:
> 
> 
>   Maximum number of vCPUs per KVM guest (KVM_MAX_NR_VCPUS) [1024] (NEW) 16
>   Maximum number of vCPUs per KVM guest (KVM_MAX_NR_VCPUS) [1024] (NEW) 8
>   Maximum number of vCPUs per KVM guest (KVM_MAX_NR_VCPUS) [1024] (NEW)
> 

Hi Toralf,

From arch/x86/kvm/Kconfig:

>config KVM_MAX_NR_VCPUS
>	int "Maximum number of vCPUs per KVM guest"
>	depends on KVM
>	range 1024 4096
>	default 4096 if MAXSMP
>	default 1024
>	help
>	  Set the maximum number of vCPUs per KVM guest. Larger values will increase
>	  the memory footprint of each KVM guest, regardless of how many vCPUs are
>	  created for a given VM.

I don't know your use case, but you can safely choose the default (1024).

Thanks.

-- 
An old man doll... just what I always wanted! - Clara

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: kconfig does not accept a lower value for KVM_MAX_NR_VCPUS
  2025-01-19 23:55 ` kconfig does not accept a lower value for KVM_MAX_NR_VCPUS Bagas Sanjaya
@ 2025-01-21 15:55   ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2025-01-21 15:55 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: Toralf Förster, Linux Kernel Mailing List, Linux KVM,
	Paolo Bonzini, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin

On Mon, Jan 20, 2025, Bagas Sanjaya wrote:
> On Sun, Jan 19, 2025 at 12:04:04PM +0100, Toralf Förster wrote:
> > I was wondering why I cannot put a lower value here during make oldconfig:

The lower limit of 1024 in the Kconfig exists to ensure backwards compatibility.
CONFIG_KVM_MAX_NR_VCPUS is effectively exposed to userspace via KVM_CAP_MAX_VCPUS,
and prior to the Kconfig KVM hardcoded KVM_CAP_MAX_VCPUS to 1024.

I did float the idea of setting the range to 1 - 4096, but we opted to go with
the conservative approach because the benefits are relatively minor, and we didn't
want to risk indirectly breaking userspace.

> >   Maximum number of vCPUs per KVM guest (KVM_MAX_NR_VCPUS) [1024] (NEW) 16
> >   Maximum number of vCPUs per KVM guest (KVM_MAX_NR_VCPUS) [1024] (NEW) 8
> >   Maximum number of vCPUs per KVM guest (KVM_MAX_NR_VCPUS) [1024] (NEW)
> > 
> 
> Hi Toralf,
> 
> From arch/x86/kvm/Kconfig:
> 
> >config KVM_MAX_NR_VCPUS
> >	int "Maximum number of vCPUs per KVM guest"
> >	depends on KVM
> >	range 1024 4096
> >	default 4096 if MAXSMP
> >	default 1024
> >	help
> >	  Set the maximum number of vCPUs per KVM guest. Larger values will increase
> >	  the memory footprint of each KVM guest, regardless of how many vCPUs are
> >	  created for a given VM.
> 
> I don't know your use case, but you can safely choose the default (1024).
> 
> Thanks.
> 
> -- 
> An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-21 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <03a04e86-c629-44df-9022-05c42b4c736f@gmx.de>
2025-01-19 23:55 ` kconfig does not accept a lower value for KVM_MAX_NR_VCPUS Bagas Sanjaya
2025-01-21 15:55   ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox