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

From: Orak Listalavostok (oraklistal_at_yahoo.com)
Date: 05/31/04


Date: 30 May 2004 21:09:46 -0700


> 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



Relevant Pages

  • Re: Is it possible to make -lpthread program to use 100% CPU?
    ... > Could you turn off Hyperthreading and report any changes? ... I have turned off hyperthreading and got result, which muddles me rather -- try ... shows that both KSE are bound to CPU 0. ... Program, built with -lthr, maxed CPU for two threads and more with consistent ...
    (freebsd-current)
  • Re: How to determine Linux real CPUs vs hyperthreaded (ht) virtual CPUs?
    ... > how do I know hyperthreading is enabled on any arbitrary Linux PC? ... This should report the total number of physical CPUs: ...
    (comp.os.linux.setup)
  • Re: How to determine Linux real CPUs vs hyperthreaded (ht) virtual CPUs?
    ... > how do I know hyperthreading is enabled on any arbitrary Linux PC? ... This should report the total number of physical CPUs: ...
    (comp.os.linux.hardware)
  • Re: [PATCH] AMD multicore detection
    ... >> two cores are reported as hyperthreading when the CPU does not ... Dual-core processors claim to be hyperthreaded, ... > when I wrote the patch which disabled hyperthreading I added extra ... It's japanese but you will be able to read the report. ...
    (freebsd-current)
  • Re: Hyperthreading
    ... and then report the output of the `!runaway` and `~*kb` ... that runs for weeks on an IBM server when ... > hyperthreading is turned off. ...
    (microsoft.public.win32.programmer.kernel)