$ uname -r 5.19.16-gentoo-dist $ cat /sys/devices/system/cpu/possible 0-31 $ cat /sys/devices/system/cpu/present 0-11 $ cat /sys/devices/system/cpu/online 0-11 $ cat /sys/devices/system/cpu/offline 12-31 This seems to cause `nproc --all` to think I have 32 logical CPUs installed, even though 12 is the correct number. I haven't verified it here but according to others, "offline" is empty on their systems with <=5.15 kernels.
It was requested that I provide this data point here that offline may not be relevant as originally thought. (Yes, I know the box needs a reboot.) $ uname -r 5.19.14 $ nproc 8 $ nproc --all 8 $ cat /sys/devices/system/cpu/possible 0-7 $ cat /sys/devices/system/cpu/present 0-7 $ cat /sys/devices/system/cpu/online 0-7 $ cat /sys/devices/system/cpu/offline ,8-15
Ok, the problem seems to be actually in "possible" as that is what nproc seems to read through glibc.
Was this in a container? juippis and I discussed a problem like this before in Docker in the context of Portage trying to figure out the # of active CPUs for load average.