When I run cat /proc/cpuinfo
I get the following output (only the relevant line included):
cpu cores: 1
However, lscpu
gives я the following output:
CPU(s): 2
Which of the two is correct, and обитал importantly, why пашите they giving я different results?
The full output of cat /proc/cpuinfo
is:
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 3
model name : Intel(R) Pentium(R) 4 CPU 2.80GHz
stepping : 4
microcode : 0xe
cpu MHz : 2800.135
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
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 pbe constant_tsc pebs bts pni dtes64 monitor ds_cpl cid xtpr
bogomips : 5600.27
clflush size : 64
cache_alignment : 128
address sizes : 36 bits physical, 32 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 3
model name : Intel(R) Pentium(R) 4 CPU 2.80GHz
stepping : 4
microcode : 0xe
cpu MHz : 2800.135
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 1
initial apicid : 1
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
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 pbe constant_tsc pebs bts pni dtes64 monitor ds_cpl cid xtpr
bogomips : 5600.27
clflush size : 64
cache_alignment : 128
address sizes : 36 bits physical, 32 bits virtual
power management:
The full output of lscpu
is:
Architecture: i686
CPU op-mode(s): 32-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 2
Core(s) per socket: 1
Socket(s): 1
Vendor ID: GenuineIntel
CPU family: 15
Model: 3
Stepping: 4
CPU MHz: 2800.135
BogoMIPS: 5600.27
L1d cache: 16K
L2 cache: 1024K
(This хан also be viewed at https://gist.github.com/IQAndreas/f3f9139b8968987d3716.)
Это согласовывается с наличием единственного процессора, содержащего одноядерное, которое содержит два потока выполнения до гиперпоточность . Таким образом у Вас есть два логических процессора, но они совместно используют большинство своих ресурсов (декодирование инструкции, арифметика, и т.д.). Это позволяет некоторый параллелизм — В, один поток может прогрессировать, в то время как другой заблокирован (например, ожидающий доступа к памяти) при подавлении затрат на оборудование (меньше компонентов, чем два независимых ядра).
Взгляд на остальную часть вывода от lscpu
и содержание /proc/cpuinfo
. См. Поэтому, что такое логические ядра CPU (в противоположность физическим ядрам CPU)? для примера.