How to determine Linux real CPUs vs hyperthreaded (ht) virtual CPUs? - Redhat

This is a discussion on How to determine Linux real CPUs vs hyperthreaded (ht) virtual CPUs? - Redhat ; Does anyone know how to determine if a given Linux machine is reporting real CPUs or hyperthreaded (ht) virtual CPUs? Using /proc/cpuinfo doesn't give any obvious difference. There is a CPU flag, ht, which reports the capability, but it's not ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: How to determine Linux real CPUs vs hyperthreaded (ht) virtual CPUs?

  1. How to determine Linux real CPUs vs hyperthreaded (ht) virtual CPUs?

    Does anyone know how to determine if a given Linux machine is reporting
    real CPUs or hyperthreaded (ht) virtual CPUs?

    Using /proc/cpuinfo doesn't give any obvious difference.
    There is a CPU flag, ht, which reports the capability,
    but it's not always switched on, as it's BIOS and OS dependent.

  2. Re: How to determine Linux real CPUs vs hyperthreaded (ht) virtual CPUs?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1
    NotDashEscaped: You need GnuPG to verify this message

    [ Please consider setting Followup-To: ]

    In comp.os.linux.misc Orak Listalavostok suggested:
    > Does anyone know how to determine if a given Linux machine is reporting
    > real CPUs or hyperthreaded (ht) virtual CPUs?


    > Using /proc/cpuinfo doesn't give any obvious difference.


    It usually does, if ht is switched on, look for:

    physical id :

    --
    Michael Heiming (GPG-Key ID: 0xEDD27B94)
    mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (GNU/Linux)

    iD8DBQFArZrpAkPEju3Se5QRApXgAJ929djS/+luHIPzIWb0oHTZkWrrnQCfYKXv
    LHYY57qXBicBwQVYCdi8iZw=
    =2eSV
    -----END PGP SIGNATURE-----

  3. Re: How to determine Linux real CPUs vs hyperthreaded (ht) virtual CPUs?

    > From: hzmonte (hzmonte@hotmail.com)
    > Subject: how do I know hyperthreading is enabled
    > Newsgroups: comp.os.linux.misc
    > Date: 2004-03-15 04:56:54 PST
    >
    > how do I know hyperthreading is enabled on any arbitrary Linux PC?


    a) This should report the total number of physical CPUs:
    grep -i "physical id" /proc/cpuinfo | sort -u | wc -l

    b) This should report the total number of logical CPUs:
    grep -i "processor" /proc/cpuinfo | sort -u | wc -l

    c) The difference, is hyperthreaded.

    Here is an annotated report from an IBM X335:
    egrep -i "processor|physical id" /proc/cpuinfo
    grep -E "processor|physical id" /proc/cpuinfo
    which outputs (for example):
    processor : 0 (CPU 0 is the first logical)
    physical id : 0 (CPU 0 is the first physical)
    processor : 1 (CPU 1 is the second logical)
    physical id : 3 (CPU 3 is the second physical)
    processor : 2 (CPU 2 is the third logical)
    physical id : 0 (CPU 0 is the first physical)
    processor : 3 (CPU 3 is the fourth logical)
    physical id : 3 (CPU 3 is the second physical)

    Orak

  4. Re: How to determine Linux real CPUs vs hyperthreaded (ht) virtualCPUs?

    Orak Listalavostok wrote:
    >>From: hzmonte (hzmonte@hotmail.com)
    >>Subject: how do I know hyperthreading is enabled
    >>Newsgroups: comp.os.linux.misc
    >>Date: 2004-03-15 04:56:54 PST
    >>
    >>how do I know hyperthreading is enabled on any arbitrary Linux PC?

    >
    >
    > a) This should report the total number of physical CPUs:
    > grep -i "physical id" /proc/cpuinfo | sort -u | wc -l
    >
    > b) This should report the total number of logical CPUs:
    > grep -i "processor" /proc/cpuinfo | sort -u | wc -l
    >
    > c) The difference, is hyperthreaded.
    >
    > Here is an annotated report from an IBM X335:
    > egrep -i "processor|physical id" /proc/cpuinfo
    > grep -E "processor|physical id" /proc/cpuinfo
    > which outputs (for example):
    > processor : 0 (CPU 0 is the first logical)
    > physical id : 0 (CPU 0 is the first physical)
    > processor : 1 (CPU 1 is the second logical)
    > physical id : 3 (CPU 3 is the second physical)
    > processor : 2 (CPU 2 is the third logical)
    > physical id : 0 (CPU 0 is the first physical)
    > processor : 3 (CPU 3 is the fourth logical)
    > physical id : 3 (CPU 3 is the second physical)
    >
    > Orak

    SCARY to use CPU second physical for two ....

    --
    .~. Jean-David Beyer Registered Linux User 85642.
    /V\ Registered Machine 241939.
    /( )\ Shrewsbury, New Jersey http://counter.li.org
    ^^-^^ 08:20:00 up 8 days, 15:35, 4 users, load average: 3.90, 3.93, 4.04


+ Reply to Thread