参考【Ubuntu 查看 CPU 缓存】
本文主要介绍cpu的cache查看,以供读者能够理解该技术的定义、原理、应用。
🎬个人简介:一个全栈工程师的升级之路!
📋个人专栏:计算机杂记
🎀CSDN主页 发狂的小花
🌄人生秘诀:学习的本质就是极致重复!
目录
L1 Cache 数据缓存的大小
L1 Cache 指令缓存的大小
L2 Cache 的大小
L3 Cache 的大小
Cache Line(缓存块)的大小
L1 Cache 数据缓存的大小
hubery@hubery:~$ cat /sys/devices/system/cpu/cpu0/cache/index0/size
32K
hubery@hubery:~$
L1 Cache 指令缓存的大小
hubery@hubery:~$ cat /sys/devices/system/cpu/cpu0/cache/index1/size
32K
hubery@hubery:~$
L2 Cache 的大小
hubery@hubery:~$ cat /sys/devices/system/cpu/cpu0/cache/index2/size
256K
hubery@hubery:~$
L3 Cache 的大小
hubery@hubery:~$ cat /sys/devices/system/cpu/cpu0/cache/index3/size
8192K
hubery@hubery:~$
Cache Line(缓存块)的大小
CPU Cache 的数据是从内存中读取过来的,它是以⼀⼩块⼀⼩块读取数据的,⽽不是按照单个数组元素来读取数据的,这样⼀⼩块⼀⼩块的数据,称为 Cache Line(缓存块)。
hubery@hubery:~$ cat /sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size
64
hubery@hubery:~$
hubery@hubery:~$ cat /sys/devices/system/cpu/cpu0/cache/index1/coherency_line_size
64
hubery@hubery:~$
hubery@hubery:~$ cat /sys/devices/system/cpu/cpu0/cache/index2/coherency_line_size
64
hubery@hubery:~$
hubery@hubery:~$ cat /sys/devices/system/cpu/cpu0/cache/index3/coherency_line_size
64
hubery@hubery:~$
意味着⼀次载⼊数据的⼤⼩是 64 字节。
🌈我的分享也就到此结束啦🌈
如果我的分享也能对你有帮助,那就太好了!
若有不足,还请大家多多指正,我们一起学习交流!
📢未来的富豪们:点赞👍→收藏⭐→关注🔍,如果能评论下就太惊喜了!
感谢大家的观看和支持!最后,☺祝愿大家每天有钱赚!!!欢迎关注、关注!