Operating System - Linux
1752584 Members
3912 Online
108788 Solutions
New Discussion

clarification needed on command cat /proc/cpuinfo on linux

 
svinoth
Contributor

clarification needed on command cat /proc/cpuinfo on linux

using an proliant server 360G5 , when i physicaly cheked i can able to see only one processor .

 

Bur i am using an command cat /proc/cpuinfo showing as processor0 and processor 1

 

basically i am using an dual core processor in my server .

 

could you clarify my doubts whether i am having an single processor or two processor ?

1 REPLY 1
Matti_Kurkela
Honored Contributor

Re: clarification needed on command cat /proc/cpuinfo on linux

It might be because of a dual-core processor, or Hyper-Threading.

 

Hyper-Threading is also indicated with a "ht" in the "flags" field in /proc/cpuinfo.

 

Depending on your Linux kernel version, the /proc/cpuinfo should contain other fields of information that might be helpful in understanding your configuration.

 

  • physical id: if both processors have the same physical ID, then both processors are within the same physical package, i.e. multi-core and/or hyper-threading CPU.
  • siblings: the number of independently running processing threads the physical package contains. If hyper-threading is enabled, each core will have two threads, which can be somewhat independent on each other (not completely independent, though) and so in some scheduling calculations it's more appropriate to count them as two units. This number is essentially (number of cores * number of threads)
  • core id: the ID number of the CPU core within the physical package. If you have two processors with the same physical ID but different core IDs, you have one dual-core processor. If both physical ID and core ID are the same in two processors, it is just Hyper-Threading within a single core.
  • cpu cores: the number of physical cores the physical package contains.

So, if your /proc/cpuinfo says:

processor    : 0
[...]
physical id  : 0
siblings     : 2
core id      : 0
cpu cores    : 1
[...]

processor    : 1
[...]
physical id  : 0
siblings     : 2
core id      : 0
cpu cores    : 1

 ...you have a single-core processor with Hyper-Threading.

 

On the other hand, a dual-core CPU without Hyper-Threading would look like this:

processor     : 0
[...]
physical id   : 0
siblings      : 2
core id       : 0
cpu cores     : 2
[...]

processor     : 1
physical id   : 0
siblings      : 2
core id       : 1
cpu cores     : 2
[...]

 

A dual-core processor with Hyper-Threading enabled would appear as 4 processor entries in /proc/cpuinfo (2 cores * 2 threads per core).

 

Two completely separate single-core, non-Hyper-Threading processors would appear like this:

processor    : 0
[...]
physical id  : 0
siblings     : 1
core id      : 0
cpu cores    : 1
[...]

processor    : 1
physical id  : 1
siblings     : 1
core id      : 0
cpu cores    : 1
[...]

 

MK