I have an AMD CPU with 8 cores and 2 threads per core. Linux (correctly) shows this as 16 "cpus". However, sysfs actually shows 32 "possible" cpus, with 16 of them not present and offline:
$ cat /sys/devices/system/cpu/possible 0-31 $ cat /sys/devices/system/cpu/present 0-15 $ cat /sys/devices/system/cpu/online 0-15 $ cat /sys/devices/system/cpu/offline 16-31
To be clear, there's nothing wrong here; there are indeed 16 logical CPUs present and online. What I'm not clear on is why Linux detects an addition 16 logical CPUs that are not present but possible.
I think these are the relevant kernel docs: https://www.kernel.org/doc/html/latest/core-api/cpu_hotplug.html. But I don't see any indication of how the number of possible CPUs is chosen. (Note that it's much lower than the
kernel_max number of CPUs, which is 8191 on my system.)
(A little additional background: I have some code that needs to parse these values. Doing the right thing seems straightforward, but I'd like to have a clear docstring explaining why the number of possible CPUs can exceed the number of present CPUs on an ordinary desktop computer.)