제가 사용하고 있는 우분투 버전은우분투 18.04.6 LTS, 커널 버전은5.4.0-148 일반. 내 프로세서는12세대 Intel(R) 코어(TM) i7-12700.
다양한 페이지 크기(1G, 2MB, 4KB)에 대해 내 CPU의 TLB 항목 수와 프로그램 실행 중 dTLB 누락 수를 알고 싶습니다.
cpuid -1
명령은 0이라고 알려줍니다.
L1 TLB/cache information: 2M/4M pages & L1 TLB (0x80000005/eax):
instruction # entries = 0x0 (0)
instruction associativity = 0x0 (0)
data # entries = 0x0 (0)
data associativity = 0x0 (0)
L1 TLB/cache information: 4K pages & L1 TLB (0x80000005/ebx):
instruction # entries = 0x0 (0)
instruction associativity = 0x0 (0)
data # entries = 0x0 (0)
data associativity = 0x0 (0)
L1 data cache information (0x80000005/ecx):
line size (bytes) = 0x0 (0)
lines per tag = 0x0 (0)
associativity = 0x0 (0)
size (KB) = 0x0 (0)
L1 instruction cache information (0x80000005/edx):
line size (bytes) = 0x0 (0)
lines per tag = 0x0 (0)
associativity = 0x0 (0)
size (KB) = 0x0 (0)
L2 TLB/cache information: 2M/4M pages & L2 TLB (0x80000006/eax):
instruction # entries = 0x0 (0)
instruction associativity = L2 off (0)
data # entries = 0x0 (0)
data associativity = L2 off (0)
L2 TLB/cache information: 4K pages & L2 TLB (0x80000006/ebx):
instruction # entries = 0x0 (0)
instruction associativity = L2 off (0)
data # entries = 0x0 (0)
data associativity = L2 off (0)
L2 unified cache information (0x80000006/ecx):
line size (bytes) = 0x40 (64)
lines per tag = 0x0 (0)
associativity = 0x7 (7)
size (KB) = 0x500 (1280)
L3 cache information (0x80000006/edx):
line size (bytes) = 0x0 (0)
lines per tag = 0x0 (0)
associativity = L2 off (0)
size (in 512KB units) = 0x0 (0)
perf stat -e dTLB-loads,dTLB-load-misses,iTLB-load-misses
지원되지 않는 쇼
고쳐 쓰다:
$ cpuid -1 -l 2
CPU:
0xff: cache data is in CPUID 4
0xfe: unknown
0xf0: 64 byte prefetching
$ cpuid -1 -l 0x18
CPU:
0x00000018 0x00: eax=0x00000004 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
$ perf -v
perf version 5.4.231
$ perf list
List of pre-defined events (to be used in -e):
branch-instructions OR branches [Hardware event]
branch-misses [Hardware event]
bus-cycles [Hardware event]
cache-misses [Hardware event]
cache-references [Hardware event]
cpu-cycles OR cycles [Hardware event]
instructions [Hardware event]
ref-cycles [Hardware event]
alignment-faults [Software event]
bpf-output [Software event]
context-switches OR cs [Software event]
cpu-clock [Software event]
cpu-migrations OR migrations [Software event]
dummy [Software event]
emulation-faults [Software event]
major-faults [Software event]
minor-faults [Software event]
page-faults OR faults [Software event]
task-clock [Software event]
나는 내 기계에 어떤 문제가 있는지 전혀 모릅니다.
답변1
당신의 기계에 뭔가 문제가 있는 것 같아요. cpuid
출력은 원시이며 특히 TLB 정보에 대한 해석이 필요합니다.Leaf 2의 정보를 확인해야 합니다.당신이 인용한 부분보다는요. 출력에서 찾거나 직접 질문할 수 있습니다.
$ cpuid -1 -l 2
CPU:
0x63: data TLB: 2M/4M pages, 4-way, 32 entries
data TLB: 1G pages, 4-way, 4 entries
0x03: data TLB: 4K pages, 4-way, 64 entries
0x76: instruction TLB: 2M/4M pages, fully, 8 entries
0xff: cache data is in CPUID leaf 4
0xb5: instruction TLB: 4K, 8-way, 64 entries
0xf0: 64 byte prefetching
0xc1: L2 TLB: 4K/2M pages, 8-way, 1024 entries
현재로서는 perf
귀하의 버전이 CPU를 인식하지 못할 수도 있습니다(확인하지 않았습니다).