zoukankan      html  css  js  c++  java
  • linux笔记-查看L1/L2/L3 cache大小

    参考资料
    https://blog.csdn.net/zklth/article/details/6280046
    https://blog.csdn.net/wofreeo/article/details/90518609

    getconf -a | grep CACHE

    ls -l /sys/devices/system/cpu/cpu0/cache/index
    index0/ index1/ index2/
    index0和Index1是一级cache中的data和instruction cache

    ls -l /sys/devices/system/cpu/cpu0/cache/index0/

    level:cache等级 L1/L2/L3
    type:cache类型, (Data Cache,D-Cache)和一级指令缓存(Instruction Cache,I-Cache)
    size: cache大小

    一级缓存可以分为一级数据缓存(Data Cache,D-Cache)和一级指令缓存(Instruction Cache,I-Cache)。
    二者分别用来存放数据以及对执行这些数据的指令进行即时解码,而且两者可以同时被CPU访问,减少了争用Cache所造成的冲突,提高了处理器效能。目前大多数CPU的一级数据缓存和一级指令缓存具有相同的容量,例如AMD的Athlon XP就具有64KB的一级数据缓存和64KB的一级指令缓存,其一级缓存就以64KB 64KB来表示,其余的CPU的一级缓存表示方法以此类推。

    一级cache, Data cache

    cat /sys/devices/system/cpu/cpu0/cache/index0/level
    cat /sys/devices/system/cpu/cpu0/cache/index0/type
    cat /sys/devices/system/cpu/cpu0/cache/index0/size
    

    一级cache, Instruction cache

    cat /sys/devices/system/cpu/cpu0/cache/index1/level
    cat /sys/devices/system/cpu/cpu0/cache/index1/type
    cat /sys/devices/system/cpu/cpu0/cache/index1/size
    

    二级cache

    cat /sys/devices/system/cpu/cpu0/cache/index2/level
    cat /sys/devices/system/cpu/cpu0/cache/index2/type
    cat /sys/devices/system/cpu/cpu0/cache/index2/size
    
  • 相关阅读:
    策略模式浅谈
    J.U.C 系列之 Tools
    RCP 主题切换
    C#利用WebClient 两种方式下载文件
    淘宝联盟
    微信公众账号开发练习1成为开发者
    第一次使用mssql游标
    C#利用com操作excel释放进程
    免费空间主机屋试用体验
    Ajax简单聊天B/S
  • 原文地址:https://www.cnblogs.com/gnivor/p/15214927.html
Copyright © 2011-2022 走看看