Number of processors in /proc/cpuinfo

The words “CPU”, “processor” and “core” are used in somewhat confusing ways. They refer to the processor architecture. A core is the smallest independent unit that implements a general-purpose processor; a processor is an assemblage of cores (on some ARM systems, a processor is an assemblage of clusters which themselves are assemblages of cores). A chip can contain one or more processors (x86 chips contain a single processor, in this sense of the word processor).

Hyperthreading means that some parts of a core are duplicated. A core with hyperthreading is sometimes presented as an assemblage of two “virtual cores” — meaning not that each core is virtual, but that the plural is virtual because these are not actually separate cores and they will sometimes have to wait while the other core is making use of a shared part.

As far as software is concerned, there is only one concept that's useful almost everywhere: the notion of parallel threads of execution. So in most software manuals, the terms CPU and processor are used to mean any one piece of hardware that executes program code. In hardware terms, this means one core, or one virtual core with hyperthreading.

Thus top shows you 4 CPUs, because you can have 4 threads executing at the same time. /proc/cpuinfo has 4 entries, one for each CPU (in that sense). The processor numbers (which are the number of the cpuNUMBER entries in /sys/devices/system/cpu) correspond to these 4 threads.

/proc/cpuinfo is one of the few places where you get information about what hardware implements these threads of execution:

physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2

means that cpu0 is one of 4 threads inside physical component (processor) number 0, and that's in core 0 among 2 in this processor.


Just answering your first question. In the output of cat /proc/cpuinfo you can see the following information:-

physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2

You can see the count of siblings is 4 and cpu cores is 2. cpu cores being 2 is that total number of cores in the processor which can be checked from the spec given in the intel's URL you have given. Similarly siblings is the one determined by number of threads which is provided by intel's HTT.

Similarly, for physical id its 0 which indicates there is only one processor chip and for core ids you can see 0 and 1 that is 2 cores in the processor.

Update: Adding answers to the other questions.

What about turbo boost ? Are all cores are turbo boosted or only physical ?

Well I'll say, all active cores are turbo-boosted. Hey buddy, you should have checked out the examples by our beloved Wikipedia . Explained with calculations too.

Any method in ubuntu to get current cpu freq. if processor is on turbo boost or not.

Turbo boost or not you can the freq details in the output of lscpu . And for a refined output:-

lscpu | grep Hz

You can try this in terminal:

sudo lscpu

This will give you an overview of your cpu physical trait. As for turbo boost or not, this is purely hardware control than the OS itself, so unless Intel has a specific drivers for Linux that can tune your processor speed, there's no solid lead to check the turbo boost state (unless there's a command code for it. Check other forums if there are any clues regarding your question).

As for me, this is what I get when I type the above command. My AMD said it is quad core, but my physical core listed over here is only 2, with 2 threads per core (adds up to 4 cores). I'm using AMD A10 APU processor 5750m.

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            21
Model:                 19
Stepping:              1
CPU MHz:               2500.000
BogoMIPS:              4990.51
Virtualization:        AMD-V
L1d cache:             16K
L1i cache:             64K
L2 cache:              2048K
NUMA node0 CPU(s):     0-3