通过sys文件系统查询cacheline的大小

bios 通过pptt table将cache信息告诉os因此可以通过查询sys文件系统来查询cacheline的大小.

linux-28ef:~ # cat /sys/devices/system/cpu/cpu1/cache/index0/type
Data
linux-28ef:~ # cat /sys/devices/system/cpu/cpu1/cache/index0/coherency_line_size
64
linux-28ef:~ # cat /sys/devices/system/cpu/cpu1/cache/index1/type
Instruction
linux-28ef:~ # cat /sys/devices/system/cpu/cpu1/cache/index1/coherency_line_size
64
linux-28ef:~ # cat /sys/devices/system/cpu/cpu1/cache/index2/type
Unified
linux-28ef:~ # cat /sys/devices/system/cpu/cpu1/cache/index2/coherency_line_size
64
linux-28ef:~ # cat /sys/devices/system/cpu/cpu1/cache/index3/type
Unified
linux-28ef:~ # cat /sys/devices/system/cpu/cpu1/cache/index3/coherency_line_size
128
发布了1432 篇原创文章 · 获赞 59 · 访问量 118万+

猜你喜欢

转载自blog.csdn.net/tiantao2012/article/details/88413359