Re: [PATCH 2/2] lscpu: fix threads-per-core calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 24, 2011 at 01:45:34PM +0100, Jan Engelhardt wrote:
> On a 24-thread/6-core SPARC T1, lscpu would wrongly output "5 threads
> per core".

Jan, it would be nice to have a dump of /sys and /proc from the
machine. Please, use tests/ts/lscpu/mk-input.sh from git tree -- it
will create a tarball with necessary files. 

I'd like to add the dump to our tests.

> It seems that the 6c T1 is simply an 8c T1 where 2c are disabled
> (offering a lesser model for a lower price, and all that marketing
> fluff). So the machine description header of the 6c T1 reports 32
> threads, but only goes on to provide 24 elements thereafter, which is
> why Linux will report threads 24-31 as "offline". So far so good.
> 
> But lscpu would take the number of all (online and offline) threads
> (32) and divides it by the number of online cores (6), which yields an
> odd 5.33 threads/core.
> 
> Simply pick the number of online threads.

Thanks.

Fixed with as small change, if I good remember the
/sys/devices/system/cpu/online file is not available on all kernels,
so it seems better to keep "nthreads = nsockets * ncores * nthreads"
as a fallback solution.

On Wed, Mar 30, 2011 at 07:09:51PM +0200, Karel Zak wrote:
>  Unfortunately, we don't have 
> 
>     lscpu --get=<valuename>
> 
>  so grep/awk is probably the right way how to parse the output. I think
>  this way is pretty unusual in scripts.

 s/unusual/usual/  sorry...

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux