yangtingkun
===========================================================
检查LINUX环境的CPU缓存
===========================================================

记录一下LINUX如何检查CPU的缓存情况。


平常经常使用/proc/cpuinfo来检查cpu的情况,不过最近发现这种情况的检查结果不准确。

更加详细的情况应该通过/var/log/dmesg来获得。

[root@BJdata1 ~]# more /proc/cpuinfo|grep cache
cache size : 4096 KB
cache_alignment : 64
cache size : 4096 KB
cache_alignment : 64
cache size : 4096 KB
cache_alignment : 64
cache size : 4096 KB
cache_alignment : 64
cache size : 4096 KB
cache_alignment : 64
cache size : 4096 KB
cache_alignment : 64
cache size : 4096 KB
cache_alignment : 64
cache size : 4096 KB
cache_alignment : 64

这里看到的CACHE SIZEL2缓存的值,不过对于操作系统无法认出L2缓存的情况,这里就显示出L1的值:

[root@haoc2008 ~]# more /proc/cpuinfo |grep cache
cache size : 64 KB
cache_alignment : 64
cache size : 64 KB
cache_alignment : 64
cache size : 64 KB
cache_alignment : 64
cache size : 64 KB
cache_alignment : 64
cache size : 64 KB
cache_alignment : 64
cache size : 64 KB
cache_alignment : 64
cache size : 64 KB
cache_alignment : 64
cache size : 64 KB
cache_alignment : 64

而详细的情况应该通过dmesg获得:

[root@BJdata1 ~]# more /var/log/dmesg |grep cache
Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes)
Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes)
Mount-cache hash table entries: 256
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 4096K
IP route cache hash table entries: 262144 (order: 9, 2097152 bytes)
Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
PCI: cache line size of 32 is not supported by device 0000:00:1d.7
SCSI device sda: drive cache: write back
SCSI device sda: drive cache: write back
SCSI device sdb: drive cache: write back
SCSI device sdb: drive cache: write back

最后提一句,感谢网友rain的提醒,才发现REDHAT早期版本对DELL的新CPU支持不好,导致CPUL2缓冲没有被认出来。这就是上面第二个/proc/cpuinfo查询出来的结果。

看来以后安装完系统,还要留意一下系统对硬件的支持情况。

yangtingkun 发表于:2007.12.20 17:08 ::分类: ( 操作系统 ) ::阅读:(514次) :: 评论 (0)

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)

 authimage


切换风格
新闻聚合
博客日历
文章归档...
最新发表...
最新评论...
最多阅读文章...
最多评论文章...
博客统计...
Blog信息
网站链接...