CONFIG_NR_CPUS=64 in -kvm is too low compared to -generic

Bug #1967131 reported by Nobuto Murata
6
This bug affects 1 person
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://launchpad.net/ubuntu/+source/linux-kvm/5.15.0-1003.3

$ lsb_release -r
Release: 20.04

$ dpkg -S /boot/config*
linux-modules-5.4.0-105-generic: /boot/config-5.4.0-105-generic
linux-modules-5.4.0-1059-kvm: /boot/config-5.4.0-1059-kvm

$ grep CONFIG_NR_CPUS /boot/config*
/boot/config-5.4.0-105-generic:CONFIG_NR_CPUS_RANGE_BEGIN=8192
/boot/config-5.4.0-105-generic:CONFIG_NR_CPUS_RANGE_END=8192
/boot/config-5.4.0-105-generic:CONFIG_NR_CPUS_DEFAULT=8192
/boot/config-5.4.0-105-generic:CONFIG_NR_CPUS=8192
/boot/config-5.4.0-1059-kvm:CONFIG_NR_CPUS_RANGE_BEGIN=2
/boot/config-5.4.0-1059-kvm:CONFIG_NR_CPUS_RANGE_END=512
/boot/config-5.4.0-1059-kvm:CONFIG_NR_CPUS_DEFAULT=64
/boot/config-5.4.0-1059-kvm:CONFIG_NR_CPUS=64

Revision history for this message
Stefan Bader (smb) wrote :

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.

Revision history for this message
Nobuto Murata (nobuto) wrote :

Thank you Stefan for the prompt response. I'm marking this as Invalid for the time being assuming the value was intended.

Changed in linux-kvm (Ubuntu):
status: New → Invalid
Revision history for this message
Stéphane Graber (stgraber) wrote :

Re-opening as until linux-kvm is deprecated or the CPC team moves over to using linux-virtual for KVM images, this is the kernel we're dealing with and that kernel should be functional.

Changed in linux-kvm (Ubuntu):
status: Invalid → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.