Mögliches Duplikat:
Ermitteln der L2-Cache-Größe unter Linux
Ich verwende einen Debian-Linux-Server und möchte die Größe des L1- und L2-Cache wissen. Kann mir jemand helfen, wie ich das herausfinden kann?
Antwort1
dmidecode
sollte Ihnen diese Informationen geben.
Für meine CPU zeigt es beispielsweise die folgende Ausgabe:
Handle 0x0002, DMI type 7, 19 bytes
Cache Information
Socket Designation: L1-Cache
Configuration: Enabled, Not Socketed, Level 1
Operational Mode: Write Through
Location: Internal
Installed Size: 64 KB
Maximum Size: 64 KB
Supported SRAM Types:
Synchronous
Installed SRAM Type: Synchronous
Speed: Unknown
Error Correction Type: Single-bit ECC
System Type: Data
Associativity: 8-way Set-associative
Handle 0x0003, DMI type 7, 19 bytes
Cache Information
Socket Designation: L2-Cache
Configuration: Enabled, Not Socketed, Level 2
Operational Mode: Write Through
Location: Internal
Installed Size: 256 KB
Maximum Size: 256 KB
Supported SRAM Types:
Synchronous
Installed SRAM Type: Synchronous
Speed: Unknown
Error Correction Type: Single-bit ECC
System Type: Data
Associativity: 8-way Set-associative
Handle 0x0004, DMI type 7, 19 bytes
Cache Information
Socket Designation: L3-Cache
Configuration: Enabled, Not Socketed, Level 3
Operational Mode: Write Back
Location: Internal
Installed Size: 3072 KB
Maximum Size: 3072 KB
Supported SRAM Types:
Synchronous
Installed SRAM Type: Synchronous
Speed: Unknown
Error Correction Type: Single-bit ECC
System Type: Unified
Associativity: <OUT OF SPEC>
Daraus können Sie ersehen, dass ich einen L1-Cache von 64 KB, einen L2-Cache von 256 KB und einen L3-Cache von 3072 KB habe.
Antwort2
Sieht aus, als wäre dies ein Duplikat von
Ermitteln der L2-Cache-Größe unter Linux
In beiden Fällen hat dmidecode bei mir jedoch nicht funktioniert, was verständlich ist, da es BIOS-Informationen meldet, die nicht immer vorhanden oder genau sind. Die beste Wahl für mich war also:
find /sys/devices/system/cpu/*/cache/index*/size -print -exec cat {} \;
/sys/devices/system/cpu/cpu0/cache/index0/size
32K
/sys/devices/system/cpu/cpu0/cache/index1/size
32K
/sys/devices/system/cpu/cpu0/cache/index2/size
6144K
/sys/devices/system/cpu/cpu1/cache/index0/size
32K
/sys/devices/system/cpu/cpu1/cache/index1/size
32K
/sys/devices/system/cpu/cpu1/cache/index2/size
6144K
Antwort3
Sie können lshw verwenden, um Cache-Informationen zu finden. Wenn es nicht installiert ist, sollten Sie es aus dem Repo beziehen.
Antwort4
x86info ist ein gutes Tool zum Abrufen von Prozessorinformationen, wenn Sie eine i386/amd64-Box verwenden.