Thread (11 messages) 11 messages, 3 authors, 2021-09-03

Re: [PATCH 6/6] x86/kvm: add boot parameter for setting max number of vcpus per guest

From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: 2021-09-03 07:41:02
Also in: kvm, lkml

Juergen Gross [off-list ref] writes:
On 14.07.21 15:21, Vitaly Kuznetsov wrote:
quoted
Juergen Gross [off-list ref] writes:
quoted
On 14.07.21 13:45, Vitaly Kuznetsov wrote:
quoted
Personally, I'd vote for introducing a 'ratio' parameter then so
generally users will only have to set 'kvm.max_vcpus'.
Okay.

Default '4' then? Or '2 ^ (topology_levels - 2)' (assuming a
topology_level of 3 on Intel: thread/core/socket and 4 on EPYC:
thread/core/package/socket).
I'd suggest we default to '4' for both Intel and AMD as we haven't given
up completely on cross-vendor VMs (running AMD VMs on Intel CPUs and
vice versa). It would be great to leave a comment where the number comes
from of course.
Thinking more about it I believe it would be better to make the
parameter something like "additional vcpu-id bits" with a default of
topology_levels - 2 (cross-vendor VMs are so special that I think the
need to specify another value explicitly in this case is acceptable).

Reasons are:

- the ability to specify factor values not being a power of 2 is weird
- just specifying the additional number of bits would lead to compatible
   behavior (e.g. a max vcpu-id of 1023 with max_vcpus being 288 and the
   default value of 1)
- the max vcpu-id should (normally) be 2^n - 1
Sounds good to me! 

Also, there's an ongoing work to raise the default KVM_MAX_VCPUS number
by Eduardo (Cc):

https://lore.kernel.org/kvm/20210831204535.1594297-1-ehabkost@redhat.com/ (local)

It would be great if you could unify your efforts)

-- 
Vitaly
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help