linux下查看cpu物理个数,核心数,是否支持超线程。

判断依据:
1.相同physical id下具有相同core id的cpu是同一个core的超线程。
2.具有相同physical id的cpu是同一颗cpu封装的线程或者cores。

英文版:
1.Physical id and core id are not necessarily consecutive but they are unique. Any cpu with the same core id are hyperthreads in the same core.
2.Any cpu with the same physical id are threads or cores in the same physical socket.

1. 查看物理CPU的个数

#cat /proc/cpuinfo

#cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l

2. 查看逻辑CPU的个数
#cat /proc/cpuinfo |grep "processor"|wc -l

 

3. 查看CPU是几核
#cat /proc/cpuinfo |grep "cores"|uniq

 

 

 

# getconf LONG_BIT

 

32

 

(说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)

 

 

 

# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l

 

8

 

(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)

 

 

 

 

 

posted @ 2012-09-25 11:06  nowhost.hk  阅读(585)  评论(0)    收藏  举报