查看CPU Cache大小

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


第一种方法就是从开机信息中查找:
[root@c0106 papi]# dmesg |grep cache
Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
Mount-cache hash table entries: 256
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 4096K
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 4096K
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 4096K
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 4096K
IP route cache hash table entries: 131072 (order: 8, 1048576 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
sdb: assuming drive cache: write through
sdb: assuming drive cache: write through
sdc: assuming drive cache: write through
sdc: assuming drive cache: write through




第二种方法:
[root@c0106 papi]# ls /sys/devices/system/cpu/cpu
cpu0/ cpu1/ cpu2/ cpu3/ 


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


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值