Documentation/driver-api/cxl/linux/overview.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API / CXL / Linux

Overview

CXL Type-3 memory가 early boot부터 DAX 또는 일반 memory page로 노출되기까지의 전체 구성을 요약합니다.

Source pathDocumentation/driver-api/cxl/linux/overview.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

overview.rst:1-103

CXL memory의 노출 경로는 firmware와 early boot의 resource·NUMA 준비, CXL driver의 device·decoder·region 생성, DAX mode 선택, memory hotplug online 순서로 진행됩니다. `hmem`은 file 접근에서 끝나고 `kmem`은 Driver Managed memory block으로 page allocator까지 이어집니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ========
4 Overview
5 ========
6
7 This section presents the configuration process of a CXL Type-3 memory device,
8 and how it is ultimately exposed to users as either a :code:`DAX` device or
9 normal memory pages via the kernel's page allocator.
10
11 Portions marked with a bullet are points at which certain kernel objects
12 are generated.
13
14 1) Early Boot
15
16 a) BIOS, Build, and Boot Parameters
17
18 i) EFI_MEMORY_SP
19 ii) CONFIG_EFI_SOFT_RESERVE
20 iii) CONFIG_MHP_DEFAULT_ONLINE_TYPE
21 iv) nosoftreserve
22
23 b) Memory Map Creation
24
25 i) EFI Memory Map / E820 Consulted for Soft-Reserved
26
27 * CXL Memory is set aside to be handled by the CXL driver
28
29 * Soft-Reserved IO Resource created for CFMWS entry
30
31 c) NUMA Node Creation
32
33 * Nodes created from ACPI CEDT CFMWS and SRAT Proximity domains (PXM)
34
35 d) Memory Tier Creation
36
37 * A default memory_tier is created with all nodes.
38
39 e) Contiguous Memory Allocation
40
41 * Any requested CMA is allocated from Online nodes
42
43 f) Init Finishes, Drivers start probing
44
45 2) ACPI and PCI Drivers
46
47 a) Detects PCI device is CXL, marking it for probe by CXL driver
48
49 3) CXL Driver Operation
50
51 a) Base device creation
52
53 * root, port, and memdev devices created
54 * CEDT CFMWS IO Resource creation
55
56 b) Decoder creation
57
58 * root, switch, and endpoint decoders created
59
60 c) Logical device creation
61
62 * memory_region and endpoint devices created
63
64 d) Devices are associated with each other
65
66 * If auto-decoder (BIOS-programmed decoders), driver validates
67 configurations, builds associations, and locks configs at probe time.
68
69 * If user-configured, validation and associations are built at
70 decoder-commit time.
71
72 e) Regions surfaced as DAX region
73
74 * dax_region created
75
76 * DAX device created via DAX driver
77
78 4) DAX Driver Operation
79
80 a) DAX driver surfaces DAX region as one of two dax device modes
81
82 * kmem - dax device is converted to hotplug memory blocks
83
84 * DAX kmem IO Resource creation
85
86 * hmem - dax device is left as daxdev to be accessed as a file.
87
88 * If hmem, journey ends here.
89
90 b) DAX kmem surfaces memory region to Memory Hotplug to add to page
91 allocator as "driver managed memory"
92
93 5) Memory Hotplug
94
95 a) mhp component surfaces a dax device memory region as multiple memory
96 blocks to the page allocator
97
98 * blocks appear in :code:`/sys/bus/memory/devices` and linked to a NUMA node
99
100 b) blocks are onlined into the requested zone (NORMAL or MOVABLE)
101
102 * Memory is marked "Driver Managed" to avoid kexec from using it as region
103 for kernel updates
104

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

CXL Type-3 memory 구성 흐름

1-13
.. SPDX-License-Identifier: GPL-2.0

이 section은 CXL Type-3 memory device의 구성 과정과, 최종적으로 사용자에게 `DAX` device 또는 kernel page allocator의 일반 memory page로 노출되는 경로를 설명합니다.

아래 과정에서 bullet로 표시한 지점은 특정 kernel object가 생성되는 시점입니다.

1단계: Early Boot

14-44

Early Boot 단계의 세부 순서는 다음과 같습니다.

  • BIOS, build, boot parameter를 평가합니다: `EFI_MEMORY_SP`, `CONFIG_EFI_SOFT_RESERVE`, `CONFIG_MHP_DEFAULT_ONLINE_TYPE`, `nosoftreserve`.
  • EFI Memory Map 또는 E820을 조회해 Soft-Reserved memory를 찾습니다.
  • CXL Memory를 CXL driver가 처리하도록 따로 두고 CFMWS entry용 Soft-Reserved IO Resource를 생성합니다.
  • ACPI CEDT CFMWS와 SRAT Proximity Domain(`PXM`)에서 NUMA node를 생성합니다.
  • 모든 node를 포함하는 기본 `memory_tier`를 생성합니다.
  • 요청된 CMA를 online node에서 할당합니다.
  • 초기화가 끝나면 driver가 probe를 시작합니다.

2단계: ACPI와 PCI driver

45-48

ACPI와 PCI driver는 PCI device가 CXL 장치임을 감지하고 CXL driver가 probe하도록 표시합니다.

3단계: CXL Driver Operation

49-77

CXL driver는 다음 순서로 object와 연결 관계를 만듭니다.

  • 기본 device를 생성합니다: root, port, memdev device와 CEDT CFMWS IO Resource.
  • root, switch, endpoint decoder를 생성합니다.
  • `memory_region`과 endpoint 같은 logical device를 생성합니다.
  • device를 서로 연결합니다.
  • auto-decoder, 즉 BIOS가 programming한 decoder이면 probe 때 구성을 검증하고 연결을 만든 뒤 configuration을 잠급니다.
  • 사용자가 구성하는 경우 decoder commit 시점에 검증과 연결을 수행합니다.
  • region을 DAX region으로 노출하고 `dax_region`을 생성합니다.
  • DAX driver를 통해 DAX device를 생성합니다.

4단계: DAX Driver Operation

78-92

DAX driver는 DAX region을 두 가지 DAX device mode 중 하나로 노출합니다.

  • `kmem`: DAX device를 hotplug memory block으로 변환하고 DAX kmem IO Resource를 생성합니다.
  • `hmem`: DAX device를 file로 접근할 수 있는 daxdev 상태로 둡니다. hmem을 선택하면 이 지점에서 구성 여정이 끝납니다.

DAX kmem은 memory region을 Memory Hotplug에 넘겨 page allocator에 `driver managed memory`로 추가합니다.

5단계: Memory Hotplug

93-103

memory-hotplug component는 DAX device memory region을 여러 memory block으로 나누어 page allocator에 노출합니다.

block은 `/sys/bus/memory/devices`에 나타나고 NUMA node에 연결됩니다. 이후 요청된 `NORMAL` 또는 `MOVABLE` zone으로 online됩니다.

kernel update에 쓰일 kexec region으로 선택되지 않도록 memory에는 `Driver Managed` 표시가 붙습니다.