요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Error Detection And Correction (EDAC) Devices
=============================================
Main Concepts used at the EDAC subsystem
----------------------------------------
There are several things to be aware of that aren't at all obvious, like
*sockets, *socket sets*, *banks*, *rows*, *chip-select rows*, *channels*,
etc...
These are some of the many terms that are thrown about that don't always
mean what people think they mean (Inconceivable!). In the interest of
creating a common ground for discussion, terms and their definitions
will be established.
* Memory devices
The individual DRAM chips on a memory stick. These devices commonly
output 4 and 8 bits each (x4, x8). Grouping several of these in parallel
provides the number of bits that the memory controller expects:
typically 72 bits, in order to provide 64 bits + 8 bits of ECC data.
* Memory Stick
A printed circuit board that aggregates multiple memory devices in
parallel. In general, this is the Field Replaceable Unit (FRU) which
gets replaced, in the case of excessive errors. Most often it is also
called DIMM (Dual Inline Memory Module).
* Memory Socket
A physical connector on the motherboard that accepts a single memory
stick. Also called as "slot" on several datasheets.
* Channel
A memory controller channel, responsible to communicate with a group of
DIMMs. Each channel has its own independent control (command) and data
bus, and can be used independently or grouped with other channels.
* Branch
It is typically the highest hierarchy on a Fully-Buffered DIMM memory
controller. Typically, it contains two channels. Two channels at the
same branch can be used in single mode or in lockstep mode. When
lockstep is enabled, the cacheline is doubled, but it generally brings
some performance penalty. Also, it is generally not possible to point to
just one memory stick when an error occurs, as the error correction code
is calculated using two DIMMs instead of one. Due to that, it is capable
of correcting more errors than on single mode.
* Single-channel
The data accessed by the memory controller is contained into one dimm
only. E. g. if the data is 64 bits-wide, the data flows to the CPU using
one 64 bits parallel access. Typically used with SDR, DDR, DDR2 and DDR3
memories. FB-DIMM and RAMBUS use a different concept for channel, so
this concept doesn't apply there.
* Double-channel
The data size accessed by the memory controller is interlaced into two
dimms, accessed at the same time. E. g. if the DIMM is 64 bits-wide (72
bits with ECC), the data flows to the CPU using a 128 bits parallel
access.
* Chip-select row
This is the name of the DRAM signal used to select the DRAM ranks to be
accessed. Common chip-select rows for single channel are 64 bits, for
dual channel 128 bits. It may not be visible by the memory controller,
as some DIMM types have a memory buffer that can hide direct access to
it from the Memory Controller.
* Single-Ranked stick
A Single-ranked stick has 1 chip-select row of memory. Motherboards
commonly drive two chip-select pins to a memory stick. A single-ranked
stick, will occupy only one of those rows. The other will be unused.
.. _doubleranked:
* Double-Ranked stick
A double-ranked stick has two chip-select rows which access different
sets of memory devices. The two rows cannot be accessed concurrently.
* Double-sided stick
**DEPRECATED TERM**, see :ref:`Double-Ranked stick <doubleranked>`.
A double-sided stick has two chip-select rows which access different sets
of memory devices. The two rows cannot be accessed concurrently.
"Double-sided" is irrespective of the memory devices being mounted on
both sides of the memory stick.
* Socket set
All of the memory sticks that are required for a single memory access or
all of the memory sticks spanned by a chip-select row. A single socket
set has two chip-select rows and if double-sided sticks are used these
will occupy those chip-select rows.
* Bank
This term is avoided because it is unclear when needing to distinguish
between chip-select rows and socket sets.
* High Bandwidth Memory (HBM)
HBM is a new memory type with low power consumption and ultra-wide
communication lanes. It uses vertically stacked memory chips (DRAM dies)
interconnected by microscopic wires called "through-silicon vias," or
TSVs.
Several stacks of HBM chips connect to the CPU or GPU through an ultra-fast
interconnect called the "interposer". Therefore, HBM's characteristics
are nearly indistinguishable from on-chip integrated RAM.
Memory Controllers
------------------
Most of the EDAC core is focused on doing Memory Controller error detection.
The :c:func:`edac_mc_alloc`. It uses internally the struct ``mem_ctl_info``
to describe the memory controllers, with is an opaque struct for the EDAC
drivers. Only the EDAC core is allowed to touch it.
.. kernel-doc:: include/linux/edac.h
.. kernel-doc:: drivers/edac/edac_mc.h
PCI Controllers
---------------
The EDAC subsystem provides a mechanism to handle PCI controllers by calling
the :c:func:`edac_pci_alloc_ctl_info`. It will use the struct
:c:type:`edac_pci_ctl_info` to describe the PCI controllers.
.. kernel-doc:: drivers/edac/edac_pci.h
EDAC Blocks
-----------
The EDAC subsystem also provides a generic mechanism to report errors on
other parts of the hardware via :c:func:`edac_device_alloc_ctl_info` function.
The structures :c:type:`edac_dev_sysfs_block_attribute`,
:c:type:`edac_device_block`, :c:type:`edac_device_instance` and
:c:type:`edac_device_ctl_info` provide a generic or abstract 'edac_device'
representation at sysfs.
This set of structures and the code that implements the APIs for the same, provide for registering EDAC type devices which are NOT standard memory or
PCI, like:
- CPU caches (L1 and L2)
- DMA engines
- Core CPU switches
- Fabric switch units
- PCIe interface controllers
- other EDAC/ECC type devices that can be monitored for
errors, etc.
It allows for a 2 level set of hierarchy.
For example, a cache could be composed of L1, L2 and L3 levels of cache.
Each CPU core would have its own L1 cache, while sharing L2 and maybe L3
caches. On such case, those can be represented via the following sysfs
nodes::
/sys/devices/system/edac/..
pci/ <existing pci directory (if available)>
mc/ <existing memory device directory>
cpu/cpu0/.. <L1 and L2 block directory>
/L1-cache/ce_count
/ue_count
/L2-cache/ce_count
/ue_count
cpu/cpu1/.. <L1 and L2 block directory>
/L1-cache/ce_count
/ue_count
/L2-cache/ce_count
/ue_count
...
the L1 and L2 directories would be "edac_device_block's"
.. kernel-doc:: drivers/edac/edac_device.h
Heterogeneous system support
----------------------------
An AMD heterogeneous system is built by connecting the data fabrics of
both CPUs and GPUs via custom xGMI links. Thus, the data fabric on the
GPU nodes can be accessed the same way as the data fabric on CPU nodes.
The MI200 accelerators are data center GPUs. They have 2 data fabrics,
and each GPU data fabric contains four Unified Memory Controllers (UMC).
Each UMC contains eight channels. Each UMC channel controls one 128-bit
HBM2e (2GB) channel (equivalent to 8 X 2GB ranks). This creates a total
of 4096-bits of DRAM data bus.
While the UMC is interfacing a 16GB (8high X 2GB DRAM) HBM stack, each UMC
channel is interfacing 2GB of DRAM (represented as rank).
Memory controllers on AMD GPU nodes can be represented in EDAC thusly:
GPU DF / GPU Node -> EDAC MC
GPU UMC -> EDAC CSROW
GPU UMC channel -> EDAC CHANNEL
For example: a heterogeneous system with 1 AMD CPU is connected to
4 MI200 (Aldebaran) GPUs using xGMI.
Some more heterogeneous hardware details:
- The CPU UMC (Unified Memory Controller) is mostly the same as the GPU UMC.
They have chip selects (csrows) and channels. However, the layouts are different
for performance, physical layout, or other reasons.
- CPU UMCs use 1 channel, In this case UMC = EDAC channel. This follows the
marketing speak. CPU has X memory channels, etc.
- CPU UMCs use up to 4 chip selects, So UMC chip select = EDAC CSROW.
- GPU UMCs use 1 chip select, So UMC = EDAC CSROW.
- GPU UMCs use 8 channels, So UMC channel = EDAC channel.
The EDAC subsystem provides a mechanism to handle AMD heterogeneous
systems by calling system specific ops for both CPUs and GPUs.
AMD GPU nodes are enumerated in sequential order based on the PCI
hierarchy, and the first GPU node is assumed to have a Node ID value
following those of the CPU nodes after latter are fully populated::
$ ls /sys/devices/system/edac/mc/
mc0 - CPU MC node 0
mc1 |
mc2 |- GPU card[0] => node 0(mc1), node 1(mc2)
mc3 |
mc4 |- GPU card[1] => node 0(mc3), node 1(mc4)
mc5 |
mc6 |- GPU card[2] => node 0(mc5), node 1(mc6)
mc7 |
mc8 |- GPU card[3] => node 0(mc7), node 1(mc8)
For example, a heterogeneous system with one AMD CPU is connected to
four MI200 (Aldebaran) GPUs using xGMI. This topology can be represented
via the following sysfs entries::
/sys/devices/system/edac/mc/..
CPU # CPU node
├── mc 0
GPU Nodes are enumerated sequentially after CPU nodes have been populated
GPU card 1 # Each MI200 GPU has 2 nodes/mcs
├── mc 1 # GPU node 0 == mc1, Each MC node has 4 UMCs/CSROWs
│ ├── csrow 0 # UMC 0
│ │ ├── channel 0 # Each UMC has 8 channels
│ │ ├── channel 1 # size of each channel is 2 GB, so each UMC has 16 GB
│ │ ├── channel 2
│ │ ├── channel 3
│ │ ├── channel 4
│ │ ├── channel 5
│ │ ├── channel 6
│ │ ├── channel 7
│ ├── csrow 1 # UMC 1
│ │ ├── channel 0
│ │ ├── ..
│ │ ├── channel 7
│ ├── .. ..
│ ├── csrow 3 # UMC 3
│ │ ├── channel 0
│ │ ├── ..
│ │ ├── channel 7
│ ├── rank 0
│ ├── .. ..
│ ├── rank 31 # total 32 ranks/dimms from 4 UMCs
├
├── mc 2 # GPU node 1 == mc2
│ ├── .. # each GPU has total 64 GB
GPU card 2
├── mc 3
│ ├── ..
├── mc 4
│ ├── ..
GPU card 3
├── mc 5
│ ├── ..
├── mc 6
│ ├── ..
GPU card 4
├── mc 7
│ ├── ..
├── mc 8
│ ├── ..
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
EDAC의 기본 memory 용어
1-39문서 제목은 `Error Detection And Correction (EDAC) Devices`입니다. EDAC subsystem을 논의할 공통 기반을 만들기 위해 socket, socket set, bank, row, chip-select row, channel처럼 흔히 혼동되는 용어를 정의합니다.
`Memory devices`는 memory stick에 실린 개별 DRAM chip입니다. 보통 각 chip이 x4 또는 x8, 즉 4bit나 8bit를 출력합니다. 여러 chip을 병렬로 묶어 memory controller가 기대하는 bit 수를 제공하며, 일반적인 ECC 구성은 data 64bit와 ECC data 8bit를 합한 72bit입니다.
`Memory Stick`은 여러 memory device를 병렬로 모은 printed circuit board입니다. error가 너무 많이 발생했을 때 교체하는 Field Replaceable Unit(FRU)이며, 대개 DIMM(Dual Inline Memory Module)이라고도 합니다.
`Memory Socket`은 memory stick 하나를 꽂는 motherboard의 물리 connector입니다. 여러 datasheet에서는 slot이라고도 부릅니다.
`Channel`은 DIMM 그룹과 통신하는 memory controller channel입니다. 각 channel은 독립적인 control(command) bus와 data bus를 가지므로 독립적으로 사용하거나 다른 channel과 묶어 사용할 수 있습니다.
chip에서 controller channel까지의 기본 단위를 정리했습니다.
Branch·channel mode·chip-select row
40-73`Branch`는 Fully-Buffered DIMM memory controller에서 보통 가장 높은 hierarchy이며 일반적으로 channel 두 개를 포함합니다. 같은 branch의 두 channel은 single mode 또는 lockstep mode로 사용할 수 있습니다.
lockstep을 활성화하면 cacheline이 두 배가 되고 보통 성능 penalty가 생깁니다. error correction code를 DIMM 하나가 아니라 두 개로 계산하므로 error가 발생해도 memory stick 하나만 특정하기 어려운 대신 single mode보다 더 많은 error를 교정할 수 있습니다.
`Single-channel`에서는 memory controller가 접근하는 data가 DIMM 하나에만 들어 있습니다. data width가 64bit라면 CPU로의 data flow는 한 번의 64bit parallel access를 사용합니다. 일반적으로 SDR, DDR, DDR2, DDR3에서 사용합니다. FB-DIMM과 RAMBUS는 channel 개념이 달라 이 정의가 적용되지 않습니다.
`Double-channel`에서는 memory controller가 접근하는 data를 DIMM 두 개에 interlace하고 동시에 접근합니다. DIMM이 64bit, ECC 포함 72bit라면 CPU로의 data flow는 128bit parallel access를 사용합니다.
`Chip-select row`는 접근할 DRAM rank를 선택하는 DRAM signal의 이름입니다. 일반적인 chip-select row width는 single channel에서 64bit, dual channel에서 128bit입니다. 일부 DIMM은 memory buffer가 memory controller의 직접 접근을 숨기므로 controller에서 chip-select row가 보이지 않을 수도 있습니다.
single, double, lockstep mode의 data 폭과 error 특성을 비교합니다.
Rank·socket set·HBM
74-119`Single-Ranked stick`은 memory chip-select row 하나를 가집니다. motherboard는 보통 memory stick에 chip-select pin 두 개를 구동하지만 single-ranked stick은 그중 row 하나만 차지하고 다른 하나는 사용하지 않습니다.
`Double-Ranked stick`은 서로 다른 memory device 집합에 접근하는 chip-select row 두 개를 가지며 두 row를 동시에 접근할 수 없습니다.
`Double-sided stick`은 deprecated term이며 `Double-Ranked stick`을 사용해야 합니다. double-sided라는 이름은 memory device가 stick 양면에 실제로 장착되었는지와 무관합니다. 이 용어도 서로 다른 device 집합에 접근하는 chip-select row 두 개를 뜻하며 동시 접근은 불가능합니다.
`Socket set`은 memory access 한 번에 필요한 모든 memory stick 또는 chip-select row 하나가 걸쳐 있는 모든 stick입니다. single socket set에는 chip-select row 두 개가 있고 double-sided stick을 쓰면 그 stick이 두 row를 차지합니다.
`Bank`는 chip-select row와 socket set을 구별해야 할 때 의미가 불명확하므로 EDAC 문서에서 피하는 용어입니다.
`High Bandwidth Memory(HBM)`은 저전력과 ultra-wide communication lane을 제공하는 새로운 memory type입니다. 수직으로 쌓은 DRAM die를 through-silicon via(TSV)라는 미세 배선으로 연결합니다. 여러 HBM chip stack은 interposer라는 초고속 interconnect를 통해 CPU 또는 GPU에 연결되므로 특성이 on-chip integrated RAM과 거의 구별되지 않습니다.
stick의 chip-select row 수와 권장 용어를 정리했습니다.
Memory Controller와 PCI Controller
120-140EDAC core의 대부분은 Memory Controller error detection에 집중합니다. `edac_mc_alloc()`이 memory controller를 위한 core object를 할당하며 내부적으로 `struct mem_ctl_info`를 사용합니다. 이 structure는 EDAC driver에 opaque하고 EDAC core만 직접 접근할 수 있습니다.
공개 EDAC 선언은 다음 header에서 kernel-doc으로 가져옵니다.
.. kernel-doc:: include/linux/edac.h
memory-controller 내부 API의 source path는 다음과 같습니다.
.. kernel-doc:: drivers/edac/edac_mc.h
PCI Controller의 경우 EDAC subsystem은 `edac_pci_alloc_ctl_info()`를 호출해 controller를 다루는 mechanism을 제공합니다. PCI controller 표현에는 `struct edac_pci_ctl_info`를 사용합니다.
.. kernel-doc:: drivers/edac/edac_pci.h
controller type별 allocation API와 representation을 연결했습니다.
일반 EDAC block
141-190EDAC subsystem은 `edac_device_alloc_ctl_info()`를 통해 memory나 PCI가 아닌 다른 hardware 부분의 error를 보고하는 generic mechanism도 제공합니다.
`struct edac_dev_sysfs_block_attribute`, `struct edac_device_block`, `struct edac_device_instance`, `struct edac_device_ctl_info`는 sysfs에서 generic 또는 abstract `edac_device` representation을 제공합니다.
이 structure 집합과 API 구현은 standard memory나 PCI가 아닌 다음 EDAC type device를 등록할 수 있게 합니다.
- CPU cache(L1과 L2)
- DMA engine
- core CPU switch
- fabric switch unit
- PCIe interface controller
- error를 monitoring할 수 있는 그 밖의 EDAC/ECC type device
generic EDAC device는 2-level hierarchy를 지원합니다. 예를 들어 cache는 L1, L2, L3 level로 구성될 수 있고 각 CPU core는 자체 L1을 가지면서 L2와 경우에 따라 L3를 공유합니다. 이를 다음 sysfs node로 표현할 수 있습니다.
/sys/devices/system/edac/..
pci/ <existing pci directory (if available)>
mc/ <existing memory device directory>
cpu/cpu0/.. <L1 and L2 block directory>
/L1-cache/ce_count
/ue_count
/L2-cache/ce_count
/ue_count
cpu/cpu1/.. <L1 and L2 block directory>
/L1-cache/ce_count
/ue_count
/L2-cache/ce_count
/ue_count
...
the L1 and L2 directories would be "edac_device_block's"
이 예에서 L1과 L2 directory가 `edac_device_block`입니다. 관련 API source path는 다음과 같습니다.
.. kernel-doc:: drivers/edac/edac_device.h
CPU instance 아래 cache block과 error counter의 두 단계 구조입니다.
AMD heterogeneous system mapping
191-226AMD heterogeneous system은 CPU와 GPU의 data fabric을 custom xGMI link로 연결합니다. 따라서 GPU node의 data fabric도 CPU node의 data fabric과 같은 방식으로 접근할 수 있습니다.
MI200 accelerator는 data center GPU이며 data fabric 두 개를 가집니다. 각 GPU data fabric에는 Unified Memory Controller(UMC) 네 개가 있고 각 UMC에는 channel 여덟 개가 있습니다. UMC channel 하나는 128-bit HBM2e 2GB channel 하나, 즉 2GB rank 여덟 개와 동등한 구성을 제어하며 총 DRAM data bus width는 4096bit입니다.
UMC 하나는 8-high x 2GB DRAM인 16GB HBM stack과 interface하고, UMC channel 하나는 rank로 표현되는 2GB DRAM과 interface합니다.
AMD GPU node의 memory controller는 EDAC에 다음과 같이 mapping됩니다.
GPU DF / GPU Node -> EDAC MC
GPU UMC -> EDAC CSROW
GPU UMC channel -> EDAC CHANNEL
예시는 AMD CPU 하나와 xGMI로 연결된 MI200(Aldebaran) GPU 네 개를 사용합니다. CPU UMC와 GPU UMC는 대부분 같고 chip select(csrow)와 channel을 가지지만 performance와 physical layout 등의 이유로 layout은 다릅니다.
- CPU UMC는 channel 하나를 사용하므로 이 경우 UMC가 EDAC channel입니다. 이는 CPU가 X memory channel을 가진다는 marketing 용어를 따릅니다.
- CPU UMC는 chip select를 최대 네 개 사용하므로 UMC chip select가 EDAC CSROW입니다.
- GPU UMC는 chip select 하나만 사용하므로 UMC 자체가 EDAC CSROW입니다.
- GPU UMC는 channel 여덟 개를 사용하므로 UMC channel이 EDAC channel입니다.
hardware hierarchy를 MC, CSROW, channel object에 대응시켰습니다.
CPU·GPU MC node 열거
227-244EDAC subsystem은 CPU와 GPU 양쪽에 system-specific operation을 호출해 AMD heterogeneous system을 처리합니다.
AMD GPU node는 PCI hierarchy에 따라 순서대로 enumerate됩니다. CPU node가 모두 채워진 다음, 첫 GPU node의 Node ID가 CPU node ID 뒤를 잇는다고 가정합니다.
$ ls /sys/devices/system/edac/mc/
mc0 - CPU MC node 0
mc1 |
mc2 |- GPU card[0] => node 0(mc1), node 1(mc2)
mc3 |
mc4 |- GPU card[1] => node 0(mc3), node 1(mc4)
mc5 |
mc6 |- GPU card[2] => node 0(mc5), node 1(mc6)
mc7 |
mc8 |- GPU card[3] => node 0(mc7), node 1(mc8)
CPU node를 먼저 배치한 뒤 GPU card별 두 node가 연속됩니다.
MI200 sysfs topology
245-298AMD CPU 하나와 xGMI로 연결된 MI200 GPU 네 개의 topology는 다음 sysfs entry로 표현됩니다. 원문의 tree와 주석을 그대로 보존합니다.
/sys/devices/system/edac/mc/..
CPU # CPU node
├── mc 0
GPU Nodes are enumerated sequentially after CPU nodes have been populated
GPU card 1 # Each MI200 GPU has 2 nodes/mcs
├── mc 1 # GPU node 0 == mc1, Each MC node has 4 UMCs/CSROWs
│ ├── csrow 0 # UMC 0
│ │ ├── channel 0 # Each UMC has 8 channels
│ │ ├── channel 1 # size of each channel is 2 GB, so each UMC has 16 GB
│ │ ├── channel 2
│ │ ├── channel 3
│ │ ├── channel 4
│ │ ├── channel 5
│ │ ├── channel 6
│ │ ├── channel 7
│ ├── csrow 1 # UMC 1
│ │ ├── channel 0
│ │ ├── ..
│ │ ├── channel 7
│ ├── .. ..
│ ├── csrow 3 # UMC 3
│ │ ├── channel 0
│ │ ├── ..
│ │ ├── channel 7
│ ├── rank 0
│ ├── .. ..
│ ├── rank 31 # total 32 ranks/dimms from 4 UMCs
├
├── mc 2 # GPU node 1 == mc2
│ ├── .. # each GPU has total 64 GB
GPU card 2
├── mc 3
│ ├── ..
├── mc 4
│ ├── ..
GPU card 3
├── mc 5
│ ├── ..
├── mc 6
│ ├── ..
GPU card 4
├── mc 7
│ ├── ..
├── mc 8
│ ├── ..
CPU node는 `mc0`입니다. GPU node는 CPU node 뒤에서 순차적으로 enumerate되며, MI200 GPU 하나는 두 node, 즉 두 MC를 가집니다.
GPU node `mc1` 예에서 MC 하나는 UMC에 해당하는 CSROW 네 개를 가집니다. CSROW 하나에는 2GB channel 여덟 개가 있어 UMC당 16GB입니다. CSROW 네 개의 32개 rank/DIMM을 합치면 MC node당 64GB이며, 같은 GPU의 두 MC node 구조가 이어집니다.
나머지 GPU card도 같은 방식으로 `mc3/mc4`, `mc5/mc6`, `mc7/mc8`에 배치됩니다.
sysfs tree의 MC, CSROW, channel, rank 관계를 수치로 정리했습니다.
요약과 해설
edac.rst:1-298EDAC은 DRAM device·DIMM·socket·channel·rank·CSROW의 의미를 명확히 하고 memory controller, PCI controller, 그 밖의 ECC hardware를 각각 전용 core object로 관리합니다. driver는 opaque `mem_ctl_info`를 직접 만지지 않고 allocation·reporting API를 사용합니다.
AMD heterogeneous system에서는 CPU와 xGMI로 연결된 MI200 GPU의 data fabric을 EDAC MC, UMC를 CSROW, UMC channel을 EDAC channel로 mapping합니다. CPU node 뒤에 GPU node를 순차 enumerate해 sysfs에서 physical/error topology를 일관되게 노출합니다.