You are not logged in.
Hello, i'm using arch linux on a laptop with 6 cores and 12 threads (AMD ryzen 5 5500U). if i run
nproc --all
it outputs 16. also the system file /sys/devices/system/cpu/offline contains 12-15. how is this possible?. there is only folders for cpu0 to cpu11
output of ls -la on /sys/devices/system/cpu
total 0
drwxr-xr-x 21 root root 0 Aug 15 12:50 .
drwxr-xr-x 10 root root 0 Aug 15 12:50 ..
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu0
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu1
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu10
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu11
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu2
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu3
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu4
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu5
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu6
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu7
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu8
drwxr-xr-x 9 root root 0 Aug 15 12:50 cpu9
drwxr-xr-x 14 root root 0 Aug 15 12:50 cpufreq
drwxr-xr-x 2 root root 0 Aug 15 13:00 cpuidle
drwxr-xr-x 2 root root 0 Aug 15 13:01 hotplug
drwxr-xr-x 2 root root 0 Aug 15 12:50 microcode
drwxr-xr-x 2 root root 0 Aug 15 13:01 power
drwxr-xr-x 2 root root 0 Aug 15 13:01 smt
drwxr-xr-x 2 root root 0 Aug 15 13:01 vulnerabilities
-r--r--r-- 1 root root 4.0K Aug 15 13:01 isolated
-r--r--r-- 1 root root 4.0K Aug 15 13:01 kernel_max
-r--r--r-- 1 root root 4.0K Aug 15 13:01 modalias
-r--r--r-- 1 root root 4.0K Aug 15 13:01 nohz_full
-r--r--r-- 1 root root 4.0K Aug 15 13:01 offline
-r--r--r-- 1 root root 4.0K Aug 15 12:50 online
-r--r--r-- 1 root root 4.0K Aug 15 12:50 possible
-r--r--r-- 1 root root 4.0K Aug 15 13:01 present
-rw-r--r-- 1 root root 4.0K Aug 15 12:50 uevent
Can someone please explain this behaviour. is there anything wrong with the hardware that i should be aware of?
Offline
Don't suggest what is returned by nproc. More important is what returns 'cat /proc/cpuinfo' or lscpu.
I have only two cores without hyper threading and 'nproc --all' returns 4, so according to nproc I have 50% more cores
Last edited by xerxes_ (2022-08-15 09:03:34)
Offline
Don't suggest what is returned by nproc. More important is what returns 'cat /proc/cpuinfo' or lscpu.
I have only two cores without hyper threading and 'nproc --all' returns 4, so according to nproc I have 50% more cores
Thanks for the reply. this command outputs 12. Which is correct. I have 12 threads on my computer. But I cannot figure out how it counted 16 of them. 4 cores are offline according to the file like I've mentioned. That's the part I'm confused about.
Offline
$ nproc
24
$ nproc --all
128
$
My processor is 12 C, 24 T .
No idea what it means but this line from dmesg seems relevant
[ 0.000000] smpboot: Allowing 128 CPUs, 104 hotplug CPUs
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
@Lone_Wolf - that is odd, for 16C32T CPU here:
% nproc
32
% nproc --all
32
% dmesg | grep hotplug
[ +0.000004] smpboot: Allowing 32 CPUs, 0 hotplug CPUs
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
$ nproc 24 $ nproc --all 128 $
My processor is 12 C, 24 T .
No idea what it means but this line from dmesg seems relevant
[ 0.000000] smpboot: Allowing 128 CPUs, 104 hotplug CPUs
This dmesg explains something. It is counting 128 CPU cores. But only 24 of them are used (128 minus 104). Which is your actual amount of hyperthreaded cores.
I also get similar dmesg log.
Allowing 16 CPUs, 4 hotplug CPUs
where 12 is used and 4 of them are "hotplugable". But it's only a 12 thread CPU in my case and 24 on yours. No idea where the the rest of them comes from
Offline
nproc analyzes contents of the
/sys/devices/system/cpu/online
/proc/stat
/proc/cpuinfo
in order of appearance
Offline
I've done some searching and it appears there are sytems / motherboards that allow adding / removing processors on the fly while the system keeps running .
Maybe my mobo and that of PROBUBBLE01 do support that ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline