linux - Strange cpuinfo, how many cores does these physical cpu has?
2014-07
At the end of this post is my /proc/cpuinfo.
I know the Physical cpu number is 2
grep 'physical id' /proc/cpuinfo|sort|uniq|wc -l
2
But how many cores does each cpu have?
The 'cpu cores' shows it has 16 cores.
But use this command it shows there are only 8 cores totally.
grep 'core id' /proc/cpuinfo
core id : 16
core id : 0
core id : 17
core id : 1
core id : 25
core id : 9
core id : 26
core id : 10
Displays the number of sibling CPUs on the same physical CPU for architectures which use hyper-threading. It's 16 on my machine. But there are 4 for physical 0 cpu, and 4 on physical 1 cpu. I really confused.
Can anybody help me?
Below is my /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 12
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.191
cache size : 256 KB
physical id : 1
siblings : 16
core id : 16
cpu cores : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
bogomips : 4803.77
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 12
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.191
cache size : 256 KB
physical id : 0
siblings : 16
core id : 0
cpu cores : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
bogomips : 4800.22
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 12
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.191
cache size : 256 KB
physical id : 1
siblings : 16
core id : 17
cpu cores : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
bogomips : 4800.13
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 12
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.191
cache size : 256 KB
physical id : 0
siblings : 16
core id : 1
cpu cores : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
bogomips : 4800.21
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 4
vendor_id : GenuineIntel
cpu family : 6
model : 12
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.191
cache size : 256 KB
physical id : 1
siblings : 16
core id : 25
cpu cores : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
bogomips : 4800.14
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 5
vendor_id : GenuineIntel
cpu family : 6
model : 12
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.191
cache size : 256 KB
physical id : 0
siblings : 16
core id : 9
cpu cores : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
bogomips : 4800.19
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 6
vendor_id : GenuineIntel
cpu family : 6
model : 12
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.191
cache size : 256 KB
physical id : 1
siblings : 16
core id : 26
cpu cores : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
bogomips : 4800.13
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 12
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.191
cache size : 256 KB
physical id : 0
siblings : 16
core id : 10
cpu cores : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
bogomips : 4800.20
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
As per Intels' specs for the processor, it's a quad-core CPU (4 distinct cores), each of which is hyperthreading enabled, which makes it appear as an octo-core.
Given that it's a Xeon, you could quite easily have a dual-socket motherboard, which means there's 2 separate chips, each of which has 4 cores, each of which can run two threads, so effectively appears to the OS as a 16-core machine.
That's Hyperthreading, which allows a single core to run two threads more-or-less in parallel. More-or-less depends on what instructions each thread is using.
For an example, I put just output from 1 core of a 16 core machine.
What does the output mean by "cpuid level" of "6"? Also, what do "bogomips" of "5992.10" and "clflush size" of "64" mean?
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2992.689
cache size : 4096 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
fpu : yes
fpu_exception: yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2
ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl
vmx cid cx16 xtpr lahf_lm
bogomips : 5992.10
clflush size : 64
cache_alignment: 128
address sizes: 40 bits physical, 48 bits virtual
power management:
most of the information that is displayed is obtained from the x86 instruction 'cpuid'. The 'level' is the maximum option set that you can safely use to interrogate the processor for information.
The Intel app note at http://www.intel.com/assets/pdf/appnote/241618.pdf contains a lot of detail on the instruction. I believe the 'level' equates to the 'function' that is listed in the document.
bogomips
is s based on the speed of a very specific set of instructions in a loop, the kernel uses the value for some timing loops. It is pretty much meaningless outside this context - some incorrectly think that it is a measure of CPU speed (which it is in this one very specific context, but not generally).
clfush
in the features list refers to the availability of the cache-line flushing feature, an instruction to tell the CPU's cache that a particular block of data is no longer needed or perhaps no longer valid (so should be re-read from elsewhere if needed). I'm guessing that the size specified in clflush size
would be the granularity with which this process can be controlled - i.e. the smallest block that can be flushed (probably related directly to the line width of the CPU's L1 caches). This too is probably not a useful thing to know, unless you are a CPU engineer or otherwise trying to debug something at a very very low level.