vmm: raise the (v)CPU limit on kvm/x86_64 - #7299
Conversation
|
Note: I have a draft of several new itegration tests here: posk-io@0a250e1, but they fail when run from a VM (i.e. they fail making a nested VM with >= 254 vCPUs). I don't have a spare baremetal host to run the tests at the moment. Another reason could be that the kernel in the VM image that is used to run the tests has a smaller CONFIG_NR_CPUS. Anyway, manual testing indicates the PR/patch series works on AMD and Intel hosts with up to 1024 vCPUs (the limit that the host KVM imposes in my tests). |
phip1611
left a comment
There was a problem hiding this comment.
Awesome, thanks for working on this! I left a few remarks.
|
Follow-up of #7299 (comment): I just noticed that using This surprises me. I expected that at least 4096 vCPUs should be supported. Aye, @tpressure? |
|
General remark: we should not generate an MPTable if we have more than 255 vCPUs but solely rely on the MADT. |
|
I'm also missing the part where you expose |
On my (Intel) system, it works fine with 768 vCPUs. I will check with my AMD system tomorrow (evening). Did you make sure to increase your ulimit correctly? I'm using |
This was done in a previous PR: cloud-hypervisor/arch/src/x86_64/mod.rs Line 756 in 5357761 |
This was done in a previous PR: cloud-hypervisor/arch/src/x86_64/mptable.rs Line 137 in 5357761 |
|
Update: I was able to boot VMs with 1024 vCPUs on both Intel and AMD hosts. For some reason max KVM host limit is 1024 on machines I have access to. Does anybody know if this is tunable? I'll lower the max vCPU limit in the PR to 8192, as this seems to be the Linux kernel's max, and do the cosmetic fixes suggested tomorrow. Will also experiment with the integration test (although it may be flaky, as it is unclear how the kvm host nr_cpu limit is determined). |
b80ff51 to
28ee5ce
Compare
kvm has a KVM_MAX_VCPUS macro which can be defined by CONFIG_KVM_MAX_NR_VCPUS, so the best method I suppose is not setting a max value in cloud hypervisor, instead, it's better to query the value from kvm. For example, qemu did like this: |
The current implementation already checks with |
That would be great to have. The challenge is that the most majority of our integration tests run on fairly small Azure VMs (8/16 vCPUs), and I'd assume that won't serve the purpose for launching a VM with 255+ vCPUs on top of it. We do have a couple baremetal x86_64 self-host runners, and we may can experiment with these machines. Not a blocker for landing this PR. |
|
@posk-io I see we are very close to conclude on this series with landing this PR (just two small comments above). It would be good to include the increased vCPU limits in our next release (scheduled next Thursday). Thanks. |
Ack. Give me a couple of hours (traveling - not in my usual habitat). |
|
Very nit but please strip the Intel from the PR name, as this works for Intel and AMD. This will help developers in the future to look through old PRs without getting confused |
Done. |
b0a0e0a to
cd04317
Compare
Signed-off-by: Peter Oskolkov <[email protected]>
Raise the max number of supported (v)CPUs on kvm x86_64 hosts to 8192 (the max allowed value of CONFIG_NR_CPUS in the Linux kernel). Other platfroms keep their existing CPU limits pending further development and testing. The change has been tested on Intel and AMD hosts. Signed-off-by: Barret Rhoden <[email protected]> Signed-off-by: Neel Natu <[email protected]> Signed-off-by: Ofir Weisse <[email protected]> Signed-off-by: Peter Oskolkov <[email protected]>
cd04317 to
a803cff
Compare
Add test_large_vcpu_count() that validates the 255+ vCPU support added in cloud-hypervisor#7299. The test: 1. Boots a VM with 256 vCPUs (max=288) 2. Hotplugs to 288 (above 255 boundary) 3. Hotunplugs to 240 (below 255 boundary) 4. Hotplugs back to 260 (crossing 255 again) Each step verifies the correct CPU count via the guest. x86_64 only since 255+ vCPU support is x86_64-specific. Requires a host with at least 288 logical CPUs (bare metal runner). Closes cloud-hypervisor#7341 Signed-off-by: Keith Adler <[email protected]>
Raise the max number of supported (v)CPUs on x86_64 kvm hosts to 8192.
Other platfroms (non-x64) keep their existing CPU limits pending further development and testing.
Signed-off-by: Barret Rhoden [email protected]
Signed-off-by: Neel Natu [email protected]
Signed-off-by: Ofir Weisse [email protected]
Signed-off-by: Peter Oskolkov [email protected]