Re: lscpu -p is a work of fiction

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

 



On Mon, May 10, 2010 at 08:32:55PM +0200, Karel Zak wrote:
> On Sun, Apr 25, 2010 at 01:21:04PM -0400, Jon Stanley wrote:
> > When trying to discover the NUMA topology of a system in a script, for
> > example. lscpu -p seems the perfect format to do so. However, it's not
> > accurate, because the CPU identifiers given in the first column bear
> > no relation whatsoever to the actual CPU's as seen by the OS.
>  
>  I can confirm this bug. It's reproducible with data from your /sys.

 The problem should be fixed in the git tree. Please, if you want to
 try it:

    git clone git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git
    cd util-linux-ng
    ./autogen.sh
    ./configure
    make -C sys-utils/ lscpu

    sys-utils/lscpu -p

> > [root@etc752754a sys-utils]# ./lscpu -p
> > # The following is the parsable format, which can be fed to other
> > # programs. Each different item in every column has an unique ID
> > # starting from zero.
> > # CPU,Core,Socket,Node,,L1d,L1i,L2,L3
> > 0,0,0,0,,0,0,0,0
> > 1,0,0,0,,0,0,0,0
> > 2,1,0,0,,1,1,1,0
> > 3,1,0,0,,1,1,1,0
> > 4,2,0,0,,2,2,2,0
> > 5,2,0,0,,2,2,2,0
> > 6,3,0,0,,3,3,3,0
> > 7,3,0,0,,3,3,3,0
> > 8,4,1,1,,4,4,4,1
> > 9,4,1,1,,4,4,4,1
> > 10,5,1,1,,5,5,5,1
> > 11,5,1,1,,5,5,5,1
> > 12,6,1,1,,6,6,6,1
> > 13,6,1,1,,6,6,6,1
> > 14,7,1,1,,7,7,7,1
> > 15,7,1,1,,7,7,7,1

 The new output:

        $ lscpu --sysroot ~/x86_64-dellr710/
        Architecture:          x86_64
        CPU op-mode(s):        32-bit, 64-bit
        CPU(s):                16
        Thread(s) per core:    2
        Core(s) per socket:    4
        CPU socket(s):         2
        NUMA node(s):          2
        Vendor ID:             GenuineIntel
        CPU family:            6
        Model:                 26
        Stepping:              5
        CPU MHz:               2527.073
        Virtualization:        VT-x
        L1d cache:             32K
        L1i cache:             32K
        L2 cache:              256K
        L3 cache:              8192K
        NUMA node0 CPU(s):     0,2,4,6,8,10,12,14
        NUMA node1 CPU(s):     1,3,5,7,9,11,13,15


        $ ./sys-utils/lscpu -p --sysroot ~/x86_64-dellr710/
        # The following is the parsable format, which can be fed to other
        # programs. Each different item in every column has an unique ID
        # starting from zero.
        # CPU,Core,Socket,Node,,L1d,L1i,L2,L3
        0,0,0,0,,0,0,0,0
        1,1,1,1,,1,1,1,1
        2,2,0,0,,2,2,2,0
        3,3,1,1,,3,3,3,1
        4,4,0,0,,4,4,4,0
        5,5,1,1,,5,5,5,1
        6,6,0,0,,6,6,6,0
        7,7,1,1,,7,7,7,1
        8,0,0,0,,0,0,0,0
        9,1,1,1,,1,1,1,1
        10,2,0,0,,2,2,2,0
        11,3,1,1,,3,3,3,1
        12,4,0,0,,4,4,4,0
        13,5,1,1,,5,5,5,1
        14,6,0,0,,6,6,6,0
        15,7,1,1,,7,7,7,1


   Karel 

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" 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