如何测试ubuntu是否激活超线程?
我觉得我的电脑上没有激活超线程。 我查看了/proc/cpuinfo
并且描述了兄弟姐妹的数量与cpu核心相同。 这意味着未激活超线程。 我怎么能激活它?
/proc/cpuinfo
部分条目:
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz stepping : 6 cpu MHz : 2997.000 cache size : 6144 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes
/ sys / bus / cpu / devices / cpu * / topology / thread_siblings_list显示核心和超线程的布局。 为了更容易可视化,我建议使用lstopo命令,安装时使用:
sudo apt-get install hwloc
并运行:
lstopo
我的ivybridge桌面有4个CPU; 每个都有一个超线程,所以我们得到一个核心P#0..3的图表,每个都有两个PU(其中一个是超线程):
如果您只想要此输出的文本版本,请使用:
lstopo -
在终端中运行top
,按键盘上的数字1
以显示标题中每个cpu的负载,那里描述了多少个cpu?
如果它们是CPU中实际核心的两倍,则超线程正在按预期工作。
要检测您是否使用超线程(也称为Intel超线程技术),您可以使用dmidecode 。
在终端:
sudo dmidecode > /tmp/dmidecode.txt gksudo gedit /tmp/dmidecode.txt
查找已填充,已启用的状态值(如下所示* … *),即“已启用”表示超线程处于活动状态
Physical CPU Handle 0x000C, DMI type 4, 32 bytes Processor Information Socket Designation: Socket 1 CPU 1 Type: Central Processor Family: Xeon Manufacturer: GenuineIntel ID: 43 0F 00 00 01 03 00 00 Signature: Type 0, Family 15, Model 4, Stepping 3 Flags: FPU (Floating-point unit on-chip) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) Version: Intel Xeon Voltage: 1.5 V External Clock: 200 MHz Max Speed: 4000 MHz Current Speed: 3800 MHz Status: *Populated, Enabled* Upgrade: ZIF Socket L1 Cache Handle: 0x0004 L2 Cache Handle: 0x0005 L3 Cache Handle: Not Provided
在超线程逻辑CPU中,您将看到未填充的状态值(如下所示* … *):
Handle 0x000D, DMI type 4, 32 bytes Processor Information Socket Designation: Socket 2 CPU 2 Type: Unknown Family: Unknown Manufacturer: Not Specified ID: 00 00 00 00 00 00 00 00 Version: Not Specified Voltage: 1.5 V External Clock: 200 MHz Max Speed: 4000 MHz Current Speed: 3800 MHz Status: *Unpopulated* Upgrade: ZIF Socket L1 Cache Handle: 0x0006 L2 Cache Handle: 0x0007 L3 Cache Handle: Not Provided
资源
在dmidecode的结果中,你可以获得类似的东西
Core Count: 6 Core Enabled: 6 Thread Count: 12
在超线程设置为ON的服务器上
要么
Core Count: 6 Core Enabled: 6 Thread Count: 6
在那些设置为OFF