요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=============================================================
Cavium ThunderX2 SoC Performance Monitoring Unit (PMU UNCORE)
=============================================================
The ThunderX2 SoC PMU consists of independent, system-wide, per-socket
PMUs such as the Level 3 Cache (L3C), DDR4 Memory Controller (DMC) and
Cavium Coherent Processor Interconnect (CCPI2).
The DMC has 8 interleaved channels and the L3C has 16 interleaved tiles.
Events are counted for the default channel (i.e. channel 0) and prorated
to the total number of channels/tiles.
The DMC and L3C support up to 4 counters, while the CCPI2 supports up to 8
counters. Counters are independently programmable to different events and
can be started and stopped individually. None of the counters support an
overflow interrupt. DMC and L3C counters are 32-bit and read every 2 seconds.
The CCPI2 counters are 64-bit and assumed not to overflow in normal operation.
PMU UNCORE (perf) driver:
The thunderx2_pmu driver registers per-socket perf PMUs for the DMC and
L3C devices. Each PMU can be used to count up to 4 (DMC/L3C) or up to 8
(CCPI2) events simultaneously. The PMUs provide a description of their
available events and configuration options under sysfs, see
/sys/bus/event_source/devices/uncore_<l3c_S/dmc_S/ccpi2_S/>; S is the socket id.
The driver does not support sampling, therefore "perf record" will not
work. Per-task perf sessions are also not supported.
Examples::
# perf stat -a -e uncore_dmc_0/cnt_cycles/ sleep 1
# perf stat -a -e \
uncore_dmc_0/cnt_cycles/,\
uncore_dmc_0/data_transfers/,\
uncore_dmc_0/read_txns/,\
uncore_dmc_0/write_txns/ sleep 1
# perf stat -a -e \
uncore_l3c_0/read_request/,\
uncore_l3c_0/read_hit/,\
uncore_l3c_0/inv_request/,\
uncore_l3c_0/inv_hit/ sleep 1
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Socket별 L3C, DMC와 CCPI2
1-17ThunderX2 SoC PMU는 Level 3 Cache(L3C), DDR4 Memory Controller(DMC), Cavium Coherent Processor Interconnect(CCPI2) 같은 독립적인 socket별 system-wide PMU로 구성됩니다.
DMC에는 interleaved channel 8개, L3C에는 interleaved tile 16개가 있습니다. Event는 기본 channel인 channel 0에서 세고 전체 channel 또는 tile 수에 맞춰 비례 환산합니다.
DMC와 L3C는 최대 4 counters, CCPI2는 최대 8 counters를 지원합니다. 각 counter의 event programming과 start/stop은 독립적입니다. 어느 counter도 overflow interrupt를 지원하지 않습니다.
DMC와 L3C counter는 32-bit이며 2초마다 읽습니다. CCPI2 counter는 64-bit이고 정상 운용에서는 overflow하지 않는다고 가정합니다.
| PMU | Counter 특성 |
|---|---|
| DMC | 32-bit, 2초마다 읽음, 최대 4 counters |
| L3C | 32-bit, 2초마다 읽음, 최대 4 counters |
| CCPI2 | 64-bit, 정상 운용에서는 overflow하지 않는다고 가정, 최대 8 counters |
| 제어 | Counter별 event programming과 start/stop이 독립적 |
Perf driver와 sysfs
18-29`thunderx2_pmu` driver는 DMC와 L3C 장치를 위한 socket별 perf PMU를 등록합니다. DMC/L3C는 최대 4개, CCPI2는 최대 8개 event를 동시에 셀 수 있습니다.
사용 가능한 event와 설정 option은 `/sys/bus/event_source/devices/uncore_<l3c_S/dmc_S/ccpi2_S/>` 아래에 있으며 `S`는 socket ID입니다.
| 항목 | 경로 또는 의미 |
|---|---|
| Driver | `thunderx2_pmu` |
| L3C | `/sys/bus/event_source/devices/uncore_l3c_S/` |
| DMC | `/sys/bus/event_source/devices/uncore_dmc_S/` |
| CCPI2 | `/sys/bus/event_source/devices/uncore_ccpi2_S/`; `S`는 socket ID |
Driver는 sampling을 지원하지 않으므로 `perf record`가 동작하지 않으며, per-task perf session도 지원하지 않습니다.
DMC와 L3C 측정 예제
30-44첫 명령은 socket 0 DMC의 cycle을 system-wide로 1초 동안 측정합니다.
# perf stat -a -e uncore_dmc_0/cnt_cycles/ sleep 1
다음 명령은 DMC counter 4개를 사용해 cycle, data transfer, read transaction, write transaction을 함께 측정합니다.
# perf stat -a -e \
uncore_dmc_0/cnt_cycles/,\
uncore_dmc_0/data_transfers/,\
uncore_dmc_0/read_txns/,\
uncore_dmc_0/write_txns/ sleep 1
마지막 명령은 L3C의 read request/hit와 invalidation request/hit를 함께 측정합니다.
# perf stat -a -e \
uncore_l3c_0/read_request/,\
uncore_l3c_0/read_hit/,\
uncore_l3c_0/inv_request/,\
uncore_l3c_0/inv_hit/ sleep 1
운영 요약
thunderx2-pmu.rst:1-44Socket별 L3C/DMC/CCPI2 PMU에서 channel 0 값을 전체 interleave 수로 비례 환산하며, counter 폭과 개수 차이를 고려해 event를 배치합니다.