linux –sysdevice 和dmidecode报告的不同CPU缓存大小

linux –sysdevice 和dmidecode报告的不同CPU缓存大小,第1张

概述我试图在我的系统中获得不同缓存级别的大小. 我试过两种技巧. a)使用来自/ sys / device的信息.这是输出. $cat /sys/devices/system/cpu/cpu0/cache/index1/size32K$cat /sys/devices/system/cpu/cpu0/cache/index2/size256K$cat /sys/devices/system/c 我试图在我的系统中获得不同缓存级别的大小.

我试过两种技巧.

a)使用来自/ sys / device的信息.这是输出.

$cat /sys/devices/system/cpu/cpu0/cache/index1/size32K$cat /sys/devices/system/cpu/cpu0/cache/index2/size256K$cat /sys/devices/system/cpu/cpu0/cache/index3/size8192K

b)使用来自dmIDecode的信息

$sudo dmIDecode -t cacheCache information    Socket Designation: cpu Internal L1    Configuration: Enabled,Not Socketed,Level 1    Operational Mode: Write Through    Location: Internal    Installed Size: 256 KB    Maximum Size: 256 KB        < .... >Cache information    Socket Designation: cpu Internal L2    Configuration: Enabled,Level 2    Operational Mode: Write Through    Location: Internal    Installed Size: 1024 KB    Maximum Size: 1024 KB        < .... >Cache information    Socket Designation: cpu Internal L3    Configuration: Enabled,Level 3    Operational Mode: Write Back    Location: Internal    Installed Size: 8192 KB    Maximum Size: 8192 KB        < .... >

报告的L2和L3缓存大小不同.有关a)为什么会出现这种差异的任何想法? b)哪种方法给出了正确的值?

其他相关信息:

$uname -alinux 3.0.0-14-generic #23somerville3-Ubuntu SMP Mon Dec 12 09:20:18 UTC 2011 x86_64 x86_64 x86_64 GNU/linuxcat /proc/cpuinfo processor   : 0vendor_ID   : GenuineIntelcpu family  : 6model       : 58model name  : Intel(R) Core(TM) i7-3770 cpu @ 3.40GHzstepPing    : 9cpu MHz     : 2400.000cache size  : 8192 KBphysical ID : 0siblings    : 8core ID     : 0cpu cores   : 4APIcID      : 0initial APIcID  : 0fpu     : yesfpu_exception   : yescpuID level : 13wp      : yesflags       : fpu vme de pse tsc msr pae mce cx8 APIc sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2APIc popcnt aes xsave avx f16c rdrand lahf_lm IDa arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpID fsgsbase smep ermsbogomips    : 6784.23clflush size    : 64cache_alignment : 64address sizes   : 36 bits physical,48 bits virtualpower management:< ... >
解决方法 一些东西:

>你有一个四核cpu>索引< n> / sys / devices / system / cpu / cpu< n> / cache中的名称与L1 / L2 / L3等不对应.有一个… / index< n> / level文件会告诉你它的级别缓存.>您的L1缓存分为两个缓存(可能是index0和index1),一个用于数据,一个用于指令(参见… / index< n> / type),每个核心. 4核* 2个半* 32K匹配dmIDecode报告的256K.> L2缓存按核心分割. 4核* 256K(来自index2)= 1024K,匹配dmIDecodes L2号.

总结

以上是内存溢出为你收集整理的linux – / sys / device /和dmidecode报告的不同CPU缓存大小全部内容,希望文章能够帮你解决linux – / sys / device /和dmidecode报告的不同CPU缓存大小所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1033419.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存