가능한 중복:
Linux에서 L2 캐시 크기 찾기
Debian Linux Server를 사용하고 있으며 L1 및 L2 캐시의 크기를 알고 싶습니다. 누구든지 나를 도울 수 있습니까? 어떻게 얻을 수 있습니까?
답변1
dmidecode
이 정보를 제공해야합니다.
예를 들어 내 CPU의 경우 다음과 같은 출력이 표시됩니다.
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>
여기에서 L1 캐시는 64kb, L2 캐시는 256kb, L3 캐시는 3072kb임을 알 수 있습니다.
답변2
다음 항목의 중복인 것 같습니다.
그러나 두 경우 모두 dmidecode가 작동하지 않았습니다. 이는 항상 존재하거나 정확하지 않은 BIOS 정보를 보고하기 때문에 의미가 있습니다. 그래서 나에게 가장 좋은 선택은 다음과 같습니다.
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
답변3
lshw를 사용하여 캐시 정보를 찾을 수 있습니다. 설치되지 않은 경우 저장소에서 가져와야 합니다.
답변4
x86info는 i386/amd64 상자를 실행하는 경우 프로세서 정보를 얻는 데 적합한 도구입니다.