我申请这个blog是为了督促自己,把自己平时的一些想法和思考结果保留下来。 本博客所有内容均为原创,如有转载请注明作者和出处

检查LINUX环境的CPU缓存

上一篇 / 下一篇  2007-12-20 00:00:00 / 个人分类:操作系统

记录一下LINUX如何检查CPU的缓存情况。


i&G#qB b}/Rj%l \0

平常经常使用/proc/cpuinfo来检查cpu的情况,不过最近发现这种情况的检查结果不准确。

更加详细的情况应该通过/var/log/dmesg来获得。

[root@BJdata1 ~]# more /proc/cpuinfo|grep cacheITPUB个人空间,L~}5VK&r:i
cache size : 4096 KBITPUB个人空间Z m(T&^W9}p_Tz
cache_alignment : 64ITPUB个人空间CH)G.T-I#n`4A
cache size : 4096 KBITPUB个人空间 G/Nu6ynq na
cache_alignment : 64
;~ |@0L;qnG0cache size : 4096 KB
aTx'n4F3I%r@N0cache_alignment : 64
6J.\ ~"]T.g0Z T0cache size : 4096 KB
@:`Dl3Q];Z0cache_alignment : 64
)UQ | Jy#j~5{1yc0cache size : 4096 KB
e$vOs$V({)MCtw0cache_alignment : 64ITPUB个人空间~*[^1x S5Ba
cache size : 4096 KB
?2o5j%s G"Un!O P.g]0cache_alignment : 64
lO*a1t,A$s1w&qF0cache size : 4096 KBITPUB个人空间:m+P^L1rN*y*P t
cache_alignment : 64ITPUB个人空间M7?tk5N` l?
cache size : 4096 KBITPUB个人空间&V.j%O @u1J8RmtT
cache_alignment : 64

这里看到的CACHE SIZEL2缓存的值,不过对于操作系统无法认出L2缓存的情况,这里就显示出L1的值:

[root@haoc2008 ~]# more /proc/cpuinfo |grep cache
BST${#S!H0cache size : 64 KB
st3N v-] VB0cache_alignment : 64
0H9V,B:C%wU0cache size : 64 KB
f-F KB8WY$t0cache_alignment : 64ITPUB个人空间5|:?9C0dp am9X)M
cache size : 64 KB
R4R-A*V^*\+z"}p0cache_alignment : 64
Q!ea;o$\)]0cache size : 64 KB
j;Z4a0fg Pzb.v5["K0cache_alignment : 64
$c-k skf*lG9E;]M E0cache size : 64 KBITPUB个人空间 hY_H}4{-I7` G;B
cache_alignment : 64ITPUB个人空间)k F!]1Md;FSG?K
cache size : 64 KBITPUB个人空间7Eq a`mP
cache_alignment : 64ITPUB个人空间bl;dul3~z
cache size : 64 KB
4@7^{!e1`$V9{8z{$I0cQ0cache_alignment : 64
D:H2\0YB6M\0cache size : 64 KB
`&O"j^ U0Dm8bXN0cache_alignment : 64

而详细的情况应该通过dmesg获得:

[root@BJdata1 ~]# more /var/log/dmesg |grep cache
*}&n"Tf gH)E0Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes)
m3]HQ S c o0Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes)
v9hO8Igc ]Q0Mount-cache hash table entries: 256
}JE]I"V8o|0CPU: L1 I cache: 32K, L1 D cache: 32KITPUB个人空间%\/MjW]%q {$lU
CPU: L2 cache: 4096K
'N_fE^}Z0IP route cache hash table entries: 262144 (order: 9, 2097152 bytes)
$b3T(}8e sO'{E zx-M(J0Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
jk$YH y4u|J0PCI: cache line size of 32 is not supported by device 0000:00:1d.7ITPUB个人空间 B-n/zq&u0c
SCSI device sda: drive cache: write backITPUB个人空间mwLreps6R
SCSI device sda: drive cache: write backITPUB个人空间Le3t,K!h$i4g@#h
SCSI device sdb: drive cache: write back
){q(~.b\JW+L0SCSI device sdb: drive cache: write back

最后提一句,感谢网友rain的提醒,才发现REDHAT早期版本对DELL的新CPU支持不好,导致CPUL2缓冲没有被认出来。这就是上面第二个/proc/cpuinfo查询出来的结果。

看来以后安装完系统,还要留意一下系统对硬件的支持情况。


TAG:

引用 删除 Guest   /   2008-04-06 15:08:31

很好啊
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar