요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
===========================================================
Amlogic SoC DDR Bandwidth Performance Monitoring Unit (PMU)
===========================================================
The Amlogic Meson G12 SoC contains a bandwidth monitor inside DRAM controller.
The monitor includes 4 channels. Each channel can count the request accessing
DRAM. The channel can count up to 3 AXI port simultaneously. It can be helpful
to show if the performance bottleneck is on DDR bandwidth.
Currently, this driver supports the following 5 perf events:
+ meson_ddr_bw/total_rw_bytes/
+ meson_ddr_bw/chan_1_rw_bytes/
+ meson_ddr_bw/chan_2_rw_bytes/
+ meson_ddr_bw/chan_3_rw_bytes/
+ meson_ddr_bw/chan_4_rw_bytes/
meson_ddr_bw/chan_{1,2,3,4}_rw_bytes/ events are channel-specific events.
Each channel support filtering, which can let the channel to monitor
individual IP module in SoC.
Below are DDR access request event filter keywords:
+ arm - from CPU
+ vpu_read1 - from OSD + VPP read
+ gpu - from 3D GPU
+ pcie - from PCIe controller
+ hdcp - from HDCP controller
+ hevc_front - from HEVC codec front end
+ usb3_0 - from USB3.0 controller
+ hevc_back - from HEVC codec back end
+ h265enc - from HEVC encoder
+ vpu_read2 - from DI read
+ vpu_write1 - from VDIN write
+ vpu_write2 - from di write
+ vdec - from legacy codec video decoder
+ hcodec - from H264 encoder
+ ge2d - from ge2d
+ spicc1 - from SPI controller 1
+ usb0 - from USB2.0 controller 0
+ dma - from system DMA controller 1
+ arb0 - from arb0
+ sd_emmc_b - from SD eMMC b controller
+ usb1 - from USB2.0 controller 1
+ audio - from Audio module
+ sd_emmc_c - from SD eMMC c controller
+ spicc2 - from SPI controller 2
+ ethernet - from Ethernet controller
Examples:
+ Show the total DDR bandwidth per seconds:
.. code-block:: bash
perf stat -a -e meson_ddr_bw/total_rw_bytes/ -I 1000 sleep 10
+ Show individual DDR bandwidth from CPU and GPU respectively, as well as
sum of them:
.. code-block:: bash
perf stat -a -e meson_ddr_bw/chan_1_rw_bytes,arm=1/ -I 1000 sleep 10
perf stat -a -e meson_ddr_bw/chan_2_rw_bytes,gpu=1/ -I 1000 sleep 10
perf stat -a -e meson_ddr_bw/chan_3_rw_bytes,arm=1,gpu=1/ -I 1000 sleep 10
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Meson G12 DDR bandwidth monitor
1-10이 문서는 `SPDX-License-Identifier: GPL-2.0`을 사용합니다. Amlogic Meson G12 SoC의 DRAM controller 안에는 bandwidth monitor가 있습니다.
Monitor는 4 channels를 가지며 각 channel은 DRAM access request를 셉니다. Channel 하나가 최대 `3 AXI port`를 동시에 셀 수 있어 performance bottleneck이 DDR bandwidth에 있는지 확인하는 데 유용합니다.
Total과 channel-specific event
11-22현재 driver는 다음 5 perf events를 지원합니다.
| Event | Perf 이름 |
|---|---|
| `total_rw_bytes` | `meson_ddr_bw/total_rw_bytes/` |
| `chan_1_rw_bytes` | `meson_ddr_bw/chan_1_rw_bytes/` |
| `chan_2_rw_bytes` | `meson_ddr_bw/chan_2_rw_bytes/` |
| `chan_3_rw_bytes` | `meson_ddr_bw/chan_3_rw_bytes/` |
| `chan_4_rw_bytes` | `meson_ddr_bw/chan_4_rw_bytes/` |
`meson_ddr_bw/chan_{1,2,3,4}_rw_bytes/`는 channel-specific events입니다. 각 channel의 filtering으로 SoC의 개별 IP module을 감시할 수 있습니다.
DDR request source keyword
23-51DDR access request event filter keyword는 request를 발생시킨 CPU, graphics/video block, PCIe/USB, storage, audio, network 등의 IP module을 선택합니다.
| Keyword | Request source |
|---|---|
| `arm` | CPU |
| `vpu_read1` | OSD + VPP read |
| `gpu` | 3D GPU |
| `pcie` | PCIe controller |
| `hdcp` | HDCP controller |
| `hevc_front` | HEVC codec front end |
| `usb3_0` | USB3.0 controller |
| `hevc_back` | HEVC codec back end |
| `h265enc` | HEVC encoder |
| `vpu_read2` | DI read |
| `vpu_write1` | VDIN write |
| `vpu_write2` | DI write |
| `vdec` | Legacy codec video decoder |
| `hcodec` | H264 encoder |
| `ge2d` | GE2D |
| `spicc1` | SPI controller 1 |
| `usb0` | USB2.0 controller 0 |
| `dma` | System DMA controller 1 |
| `arb0` | ARB0 |
| `sd_emmc_b` | SD eMMC B controller |
| `usb1` | USB2.0 controller 1 |
| `audio` | Audio module |
| `sd_emmc_c` | SD eMMC C controller |
| `spicc2` | SPI controller 2 |
| `ethernet` | Ethernet controller |
Total과 IP별 bandwidth 측정
52-701초 간격으로 10초 동안 total DDR bandwidth를 표시하는 예제입니다.
perf stat -a -e meson_ddr_bw/total_rw_bytes/ -I 1000 sleep 10
Channel 1에서 CPU, channel 2에서 GPU를 각각 측정하고 channel 3에서 두 source의 합을 측정하는 예제입니다.
perf stat -a -e meson_ddr_bw/chan_1_rw_bytes,arm=1/ -I 1000 sleep 10
perf stat -a -e meson_ddr_bw/chan_2_rw_bytes,gpu=1/ -I 1000 sleep 10
perf stat -a -e meson_ddr_bw/chan_3_rw_bytes,arm=1,gpu=1/ -I 1000 sleep 10
운영 요약
meson-ddr-pmu.rst:1-70Total bandwidth를 먼저 확인한 뒤 4개 channel에 CPU, GPU 등 최대 3개 AXI port source를 배치하여 DDR bottleneck의 원인을 분리합니다.