linux环境检查,检查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 SIZE是L2缓存的值,不过对于操作系统无法认出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支持不好,导致CPU的L2缓冲没有被认出来。这就是上面第二个/proc/cpuinfo查询出来的结果。

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值