Chinaunix首页 | 论坛 | 博客
  • 博客访问: 542582
  • 博文数量: 76
  • 博客积分: 2990
  • 博客等级: 少校
  • 技术积分: 827
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-26 10:53
文章分类

全部博文(76)

文章存档

2011年(47)

2010年(13)

2009年(5)

2008年(11)

分类: LINUX

2009-03-19 13:42:35

Understanding /proc/cpuinfo

Example:

$ uname -r
2.6.18-8.el5

How many physical processors are there?

grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l
2

How many virtual processors are there?

$ grep ^processor /proc/cpuinfo | wc -l
4

Are the processors dual-core (or multi-core)?

$ grep 'cpu cores' /proc/cpuinfo
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2


"2" indicates the two physical processors are dual-core, resulting in 4 virtual processors.

If "1" was returned, the two physical processors are single-core. If the processors are single-core, and the number of virtual processors is greater than the number of physical processors, the CPUs are using hyper-threading. Hyper-threading is supported if
ht is present in the CPU flags and you are using an SMP kernel.

Are the processors 64-bit?

A 64-bit processor will have lm ("long mode") in the flags section of cpuinfo. A 32-bit processor will not.

e.g.,

flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8legacy ts fid vid ttp tm stc

What do the CPU flags mean?

The CPU flags are briefly described in the kernel header file cpufeature.h.
阅读(938) | 评论(0) | 转发(0) |
0

上一篇:系统监控脚本

下一篇:linux date -d参数用法

给主人留下些什么吧!~~