查看CPU Cache大小

转载自:http://blog.csdn.net/zhuliting/article/details/6744090

因为论文需要CPU cache的相关信息,但intel官方网站上http://ark.intel.com/#desktopprocessors只能查到L2 cache的大小。于是从网络上找到了linux系统下查看Cache大小的两种方法。



第一种方法就是从开机信息中查找:
[plain]  view plain copy print ?
  1. [root@c0106 papi]# dmesg |grep cache  
  2. Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)  
  3. Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)  
  4. Mount-cache hash table entries: 256  
  5. CPU: L1 I cache: 32K, L1 D cache: 32K  
  6. CPU: L2 cache: 4096K  
  7. CPU: L1 I cache: 32K, L1 D cache: 32K  
  8. CPU: L2 cache: 4096K  
  9. CPU: L1 I cache: 32K, L1 D cache: 32K  
  10. CPU: L2 cache: 4096K  
  11. CPU: L1 I cache: 32K, L1 D cache: 32K  
  12. CPU: L2 cache: 4096K  
  13. IP route cache hash table entries: 131072 (order: 8, 1048576 bytes)  
  14. Dquot-cache hash table entries: 512 (order 0, 4096 bytes)  
  15. PCI: cache line size of 32 is not supported by device 0000:00:1d.7  
  16. SCSI device sda: drive cache: write back  
  17. SCSI device sda: drive cache: write back  
  18. sdb: assuming drive cache: write through  
  19. sdb: assuming drive cache: write through  
  20. sdc: assuming drive cache: write through  
  21. sdc: assuming drive cache: write through  




第二种方法:
[plain]  view plain copy print ?
  1. [root@c0106 papi]# ls /sys/devices/system/cpu/cpu  
  2. cpu0/ cpu1/ cpu2/ cpu3/   


本机为深腾1800的一个子节点,双核,启用超线程技术,所以这里显示了四个CPU。
[plain]  view plain copy print ?
  1. [root@c0106 papi]# ls /sys/devices/system/cpu/cpu0/cache/  
  2. index0  index1  index2  
  3. [root@c0106 papi]# cat  /sys/devices/system/cpu/cpu0/cache/index0/level   
  4. 1  
  5. [root@c0106 papi]# cat  /sys/devices/system/cpu/cpu0/cache/index0/type  
  6. Data  
  7. [root@c0106 papi]# cat  /sys/devices/system/cpu/cpu0/cache/index0/size  
  8. 32K  


从上面可以看出,这里显示的为一级数据cache的信息。二级Cache的相关信息在 ndex1  index2  目录下
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值