CONFIG_NR_CPUS=64 in -kvm is too low compared to -generic
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-kvm (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
-kvm flavor has CONFIG_NR_CPUS=64 although -generic has CONFIG_NR_CPUS=8192 these days.
It will be a problem especially when launching a VM on top of a hypervisor with more than 64 CPU threads available. Then the guest can only use up to 64 vCPUs even when more vCPUs are allocated by a hypervisor.
I've checked the latest available package for Jammy, but there was no change around CONFIG_NR_CPUS.
https:/
$ lsb_release -r
Release: 20.04
$ dpkg -S /boot/config*
linux-modules-
linux-modules-
$ grep CONFIG_NR_CPUS /boot/config*
/boot/config-
/boot/config-
/boot/config-
/boot/config-
/boot/config-
/boot/config-
/boot/config-
/boot/config-
Naming this derivative kernel "kvm" was not the best idea in hindsight. It was done to achieve fast booting guest images. Towards that goal everything was streamlined and part of that is keeping per-cpu structures smaller by limiting the number of CPUs.
The generic kernel (which should be installed via the linux-generic meta-package) can run as a VM guest but for that has the downside of pulling in some bigger dependent packages (linux-firmware, crda, linux-modules- extra, ...). To avoid that there is the linux-virtual meta-package which will only pull in the kernel and a sub-set of kernel modules (without linux-modules- extra) and the other dependencies. That reduces its on-disk footprint.