]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lscpu: print correct number of threads per core if possible
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 29 Jul 2016 12:13:36 +0000 (14:13 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Aug 2016 11:35:05 +0000 (13:35 +0200)
commit2c497d328840c8cf6d915675fd6168ff616517d3
tree93e89e56034d8e98b9ddd734ea98b364b60ce33a
parent6417dd7ffd01bc856f9c7872d5e4d3865d0e281a
lscpu: print correct number of threads per core if possible

lscpu calculates the number of threads per core by dividing the number
of online cpus with the number of cores. This may or may not give the
correct number of threads per core depending on the number of online
CPUs (and which CPUs are online).

At least on s390 there is a new "max thread id" field within
/proc/cpuinfo present which reliably allows us to tell the number of
threads per core. Let's use this instead, like we already have also
special treatment to figure out the number core per socket etc. on
s390.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
sys-utils/lscpu.c