记录一下LINUX如何检查CPU的缓存情况。
i&G#qBb}/Rj%l
\0平常经常使用/proc/cpuinfo来检查cpu的情况,不过最近发现这种情况的检查结果不准确。
更加详细的情况应该通过/var/log/dmesg来获得。
[root@BJdata1 ~]# more /proc/cpuinfo|grep cacheITPUB个人空间,L~}5VK&r:i
cache size : 4096 KBITPUB个人空间 Zm(T&^ W9}p_Tz
cache_alignment : 64ITPUB个人空间CH)G.T-I#n`4A
cache size : 4096 KBITPUB个人空间G/Nu6yn qna
cache_alignment : 64
;~
|@0L;qn G0cache size : 4096 KB
aTx'n4F3I%r@N0cache_alignment : 64
6J.\
~"]T.g0ZT0cache size : 4096 KB
@:`Dl3Q];Z0cache_alignment : 64
)UQ|
Jy#j~5{1yc0cache size : 4096 KB
e$v Os$V({)MCtw0cache_alignment : 64ITPUB个人空间~*[^1x S5Ba
cache size : 4096 KB
?2o5j%s
G"Un!OP.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 SIZE是L2缓存的值,不过对于操作系统无法认出L2缓存的情况,这里就显示出L1的值:
[root@haoc2008 ~]# more /proc/cpuinfo |grep cache
BST${#S!H0cache size : 64 KB
st3Nv-]
VB0cache_alignment : 64
0H9V,B:C%wU0cache size : 64 KB
f-FKB8WY$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个人空间b l;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)
v9hO8Ig c]Q0Mount-cache hash table entries: 256
}J E]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(}8esO'{E
zx-M(J0Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
jk$YHy4u|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支持不好,导致CPU的L2缓冲没有被认出来。这就是上面第二个/proc/cpuinfo查询出来的结果。
看来以后安装完系统,还要留意一下系统对硬件的支持情况。