← Documents Documentation/mm/arch_pgtable_helpers.rst GitHub 원문 ↗

Linux 6.18.37 · Memory management

Architecture Page Table Helpers

Generic MM이 architecture별 PTE·PMD·PUD·HugeTLB·SWAP helper에 요구하는 공통 semantics를 정리합니다.

Source pathDocumentation/mm/arch_pgtable_helpers.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

arch_pgtable_helpers.rst:1-250

Architecture 구현은 entry level마다 검사 helper, immutable-style 변환 helper, pointer 기반 clear·permission update helper의 의미를 동일하게 맞춰야 합니다. `CONFIG_DEBUG_VM_PGTABLE`이 이 contract를 boot 때 검사합니다.

Page-table helper 범위
Family대상특수 동작
PTEBase-page entrysoft-dirty·swap PTE
PMDMiddle-directory entryTHP·huge mapping
PUDUpper-directory entryTHP·huge mapping
HugeTLBExplicit huge pagedirty·write·access
SWAPPTE/PMD swap encodingmigration entry

문서가 규정하는 다섯 helper family와 핵심 대상을 요약합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ===============================
4 Architecture Page Table Helpers
5 ===============================
6
7 Generic MM expects architectures (with MMU) to provide helpers to create, access
8 and modify page table entries at various level for different memory functions.
9 These page table helpers need to conform to a common semantics across platforms.
10 Following tables describe the expected semantics which can also be tested during
11 boot via CONFIG_DEBUG_VM_PGTABLE option. All future changes in here or the debug
12 test need to be in sync.
13
14
15 PTE Page Table Helpers
16 ======================
17
18 +---------------------------+--------------------------------------------------+
19 | pte_same | Tests whether both PTE entries are the same |
20 +---------------------------+--------------------------------------------------+
21 | pte_present | Tests a valid mapped PTE |
22 +---------------------------+--------------------------------------------------+
23 | pte_young | Tests a young PTE |
24 +---------------------------+--------------------------------------------------+
25 | pte_dirty | Tests a dirty PTE |
26 +---------------------------+--------------------------------------------------+
27 | pte_write | Tests a writable PTE |
28 +---------------------------+--------------------------------------------------+
29 | pte_special | Tests a special PTE |
30 +---------------------------+--------------------------------------------------+
31 | pte_protnone | Tests a PROT_NONE PTE |
32 +---------------------------+--------------------------------------------------+
33 | pte_soft_dirty | Tests a soft dirty PTE |
34 +---------------------------+--------------------------------------------------+
35 | pte_swp_soft_dirty | Tests a soft dirty swapped PTE |
36 +---------------------------+--------------------------------------------------+
37 | pte_mkyoung | Creates a young PTE |
38 +---------------------------+--------------------------------------------------+
39 | pte_mkold | Creates an old PTE |
40 +---------------------------+--------------------------------------------------+
41 | pte_mkdirty | Creates a dirty PTE |
42 +---------------------------+--------------------------------------------------+
43 | pte_mkclean | Creates a clean PTE |
44 +---------------------------+--------------------------------------------------+
45 | pte_mkwrite | Creates a writable PTE of the type specified by |
46 | | the VMA. |
47 +---------------------------+--------------------------------------------------+
48 | pte_mkwrite_novma | Creates a writable PTE, of the conventional type |
49 | | of writable. |
50 +---------------------------+--------------------------------------------------+
51 | pte_wrprotect | Creates a write protected PTE |
52 +---------------------------+--------------------------------------------------+
53 | pte_mkspecial | Creates a special PTE |
54 +---------------------------+--------------------------------------------------+
55 | pte_mksoft_dirty | Creates a soft dirty PTE |
56 +---------------------------+--------------------------------------------------+
57 | pte_clear_soft_dirty | Clears a soft dirty PTE |
58 +---------------------------+--------------------------------------------------+
59 | pte_swp_mksoft_dirty | Creates a soft dirty swapped PTE |
60 +---------------------------+--------------------------------------------------+
61 | pte_swp_clear_soft_dirty | Clears a soft dirty swapped PTE |
62 +---------------------------+--------------------------------------------------+
63 | pte_mknotpresent | Invalidates a mapped PTE |
64 +---------------------------+--------------------------------------------------+
65 | ptep_clear | Clears a PTE |
66 +---------------------------+--------------------------------------------------+
67 | ptep_get_and_clear | Clears and returns PTE |
68 +---------------------------+--------------------------------------------------+
69 | ptep_get_and_clear_full | Clears and returns PTE (batched PTE unmap) |
70 +---------------------------+--------------------------------------------------+
71 | ptep_test_and_clear_young | Clears young from a PTE |
72 +---------------------------+--------------------------------------------------+
73 | ptep_set_wrprotect | Converts into a write protected PTE |
74 +---------------------------+--------------------------------------------------+
75 | ptep_set_access_flags | Converts into a more permissive PTE |
76 +---------------------------+--------------------------------------------------+
77
78
79 PMD Page Table Helpers
80 ======================
81
82 +---------------------------+--------------------------------------------------+
83 | pmd_same | Tests whether both PMD entries are the same |
84 +---------------------------+--------------------------------------------------+
85 | pmd_bad | Tests a non-table mapped PMD |
86 +---------------------------+--------------------------------------------------+
87 | pmd_leaf | Tests a leaf mapped PMD |
88 +---------------------------+--------------------------------------------------+
89 | pmd_trans_huge | Tests a Transparent Huge Page (THP) at PMD |
90 +---------------------------+--------------------------------------------------+
91 | pmd_present | Tests whether pmd_page() points to valid memory |
92 +---------------------------+--------------------------------------------------+
93 | pmd_young | Tests a young PMD |
94 +---------------------------+--------------------------------------------------+
95 | pmd_dirty | Tests a dirty PMD |
96 +---------------------------+--------------------------------------------------+
97 | pmd_write | Tests a writable PMD |
98 +---------------------------+--------------------------------------------------+
99 | pmd_special | Tests a special PMD |
100 +---------------------------+--------------------------------------------------+
101 | pmd_protnone | Tests a PROT_NONE PMD |
102 +---------------------------+--------------------------------------------------+
103 | pmd_soft_dirty | Tests a soft dirty PMD |
104 +---------------------------+--------------------------------------------------+
105 | pmd_swp_soft_dirty | Tests a soft dirty swapped PMD |
106 +---------------------------+--------------------------------------------------+
107 | pmd_mkyoung | Creates a young PMD |
108 +---------------------------+--------------------------------------------------+
109 | pmd_mkold | Creates an old PMD |
110 +---------------------------+--------------------------------------------------+
111 | pmd_mkdirty | Creates a dirty PMD |
112 +---------------------------+--------------------------------------------------+
113 | pmd_mkclean | Creates a clean PMD |
114 +---------------------------+--------------------------------------------------+
115 | pmd_mkwrite | Creates a writable PMD of the type specified by |
116 | | the VMA. |
117 +---------------------------+--------------------------------------------------+
118 | pmd_mkwrite_novma | Creates a writable PMD, of the conventional type |
119 | | of writable. |
120 +---------------------------+--------------------------------------------------+
121 | pmd_wrprotect | Creates a write protected PMD |
122 +---------------------------+--------------------------------------------------+
123 | pmd_mkspecial | Creates a special PMD |
124 +---------------------------+--------------------------------------------------+
125 | pmd_mksoft_dirty | Creates a soft dirty PMD |
126 +---------------------------+--------------------------------------------------+
127 | pmd_clear_soft_dirty | Clears a soft dirty PMD |
128 +---------------------------+--------------------------------------------------+
129 | pmd_swp_mksoft_dirty | Creates a soft dirty swapped PMD |
130 +---------------------------+--------------------------------------------------+
131 | pmd_swp_clear_soft_dirty | Clears a soft dirty swapped PMD |
132 +---------------------------+--------------------------------------------------+
133 | pmd_mkinvalid | Invalidates a present PMD; do not call for |
134 | | non-present PMD [1] |
135 +---------------------------+--------------------------------------------------+
136 | pmd_set_huge | Creates a PMD huge mapping |
137 +---------------------------+--------------------------------------------------+
138 | pmd_clear_huge | Clears a PMD huge mapping |
139 +---------------------------+--------------------------------------------------+
140 | pmdp_get_and_clear | Clears a PMD |
141 +---------------------------+--------------------------------------------------+
142 | pmdp_get_and_clear_full | Clears a PMD |
143 +---------------------------+--------------------------------------------------+
144 | pmdp_test_and_clear_young | Clears young from a PMD |
145 +---------------------------+--------------------------------------------------+
146 | pmdp_set_wrprotect | Converts into a write protected PMD |
147 +---------------------------+--------------------------------------------------+
148 | pmdp_set_access_flags | Converts into a more permissive PMD |
149 +---------------------------+--------------------------------------------------+
150
151
152 PUD Page Table Helpers
153 ======================
154
155 +---------------------------+--------------------------------------------------+
156 | pud_same | Tests whether both PUD entries are the same |
157 +---------------------------+--------------------------------------------------+
158 | pud_bad | Tests a non-table mapped PUD |
159 +---------------------------+--------------------------------------------------+
160 | pud_leaf | Tests a leaf mapped PUD |
161 +---------------------------+--------------------------------------------------+
162 | pud_trans_huge | Tests a Transparent Huge Page (THP) at PUD |
163 +---------------------------+--------------------------------------------------+
164 | pud_present | Tests a valid mapped PUD |
165 +---------------------------+--------------------------------------------------+
166 | pud_young | Tests a young PUD |
167 +---------------------------+--------------------------------------------------+
168 | pud_dirty | Tests a dirty PUD |
169 +---------------------------+--------------------------------------------------+
170 | pud_write | Tests a writable PUD |
171 +---------------------------+--------------------------------------------------+
172 | pud_mkyoung | Creates a young PUD |
173 +---------------------------+--------------------------------------------------+
174 | pud_mkold | Creates an old PUD |
175 +---------------------------+--------------------------------------------------+
176 | pud_mkdirty | Creates a dirty PUD |
177 +---------------------------+--------------------------------------------------+
178 | pud_mkclean | Creates a clean PUD |
179 +---------------------------+--------------------------------------------------+
180 | pud_mkwrite | Creates a writable PUD |
181 +---------------------------+--------------------------------------------------+
182 | pud_wrprotect | Creates a write protected PUD |
183 +---------------------------+--------------------------------------------------+
184 | pud_mkinvalid | Invalidates a present PUD; do not call for |
185 | | non-present PUD [1] |
186 +---------------------------+--------------------------------------------------+
187 | pud_set_huge | Creates a PUD huge mapping |
188 +---------------------------+--------------------------------------------------+
189 | pud_clear_huge | Clears a PUD huge mapping |
190 +---------------------------+--------------------------------------------------+
191 | pudp_get_and_clear | Clears a PUD |
192 +---------------------------+--------------------------------------------------+
193 | pudp_get_and_clear_full | Clears a PUD |
194 +---------------------------+--------------------------------------------------+
195 | pudp_test_and_clear_young | Clears young from a PUD |
196 +---------------------------+--------------------------------------------------+
197 | pudp_set_wrprotect | Converts into a write protected PUD |
198 +---------------------------+--------------------------------------------------+
199 | pudp_set_access_flags | Converts into a more permissive PUD |
200 +---------------------------+--------------------------------------------------+
201
202
203 HugeTLB Page Table Helpers
204 ==========================
205
206 +---------------------------+--------------------------------------------------+
207 | pte_huge | Tests a HugeTLB |
208 +---------------------------+--------------------------------------------------+
209 | arch_make_huge_pte | Creates a HugeTLB |
210 +---------------------------+--------------------------------------------------+
211 | huge_pte_dirty | Tests a dirty HugeTLB |
212 +---------------------------+--------------------------------------------------+
213 | huge_pte_write | Tests a writable HugeTLB |
214 +---------------------------+--------------------------------------------------+
215 | huge_pte_mkdirty | Creates a dirty HugeTLB |
216 +---------------------------+--------------------------------------------------+
217 | huge_pte_mkwrite | Creates a writable HugeTLB |
218 +---------------------------+--------------------------------------------------+
219 | huge_pte_wrprotect | Creates a write protected HugeTLB |
220 +---------------------------+--------------------------------------------------+
221 | huge_ptep_get_and_clear | Clears a HugeTLB |
222 +---------------------------+--------------------------------------------------+
223 | huge_ptep_set_wrprotect | Converts into a write protected HugeTLB |
224 +---------------------------+--------------------------------------------------+
225 | huge_ptep_set_access_flags | Converts into a more permissive HugeTLB |
226 +---------------------------+--------------------------------------------------+
227
228
229 SWAP Page Table Helpers
230 ========================
231
232 +---------------------------+--------------------------------------------------+
233 | __pte_to_swp_entry | Creates a swp_entry_t (arch) from a swap PTE |
234 +---------------------------+--------------------------------------------------+
235 | __swp_entry_to_pte | Creates a swap PTE from a swp_entry_t (arch) |
236 +---------------------------+--------------------------------------------------+
237 | __pmd_to_swp_entry | Creates a swp_entry_t (arch) from a swap PMD |
238 +---------------------------+--------------------------------------------------+
239 | __swp_entry_to_pmd | Creates a swap PMD from a swp_entry_t (arch) |
240 +---------------------------+--------------------------------------------------+
241 | is_migration_entry | Tests a migration (read or write) swapped entry |
242 +-------------------------------+----------------------------------------------+
243 | is_writable_migration_entry | Tests a write migration swapped entry |
244 +-------------------------------+----------------------------------------------+
245 | make_readable_migration_entry | Creates a read migration swapped entry |
246 +-------------------------------+----------------------------------------------+
247 | make_writable_migration_entry | Creates a write migration swapped entry |
248 +-------------------------------+----------------------------------------------+
249
250 [1] https://lore.kernel.org/linux-mm/20181017020930.GN30832@redhat.com/
251

3. 한국어 전문 번역

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

Architecture 공통 semantics

1-14

Generic MM은 MMU가 있는 architecture가 여러 page-table level에서 memory 기능에 필요한 entry 생성·접근·수정 helper를 제공한다고 가정합니다.

이 helper는 platform 전체에서 공통 semantics를 따라야 합니다. 다음 표의 기대 동작은 boot 중 `CONFIG_DEBUG_VM_PGTABLE` option으로 검사할 수 있습니다. 이 문서와 debug test의 향후 변경은 항상 동기화해야 합니다.

.. SPDX-License-Identifier: GPL-2.0

===============================
Architecture Page Table Helpers
===============================

Generic MM expects architectures (with MMU) to provide helpers to create, access
and modify page table entries at various level for different memory functions.
These page table helpers need to conform to a common semantics across platforms.
Following tables describe the expected semantics which can also be tested during
boot via CONFIG_DEBUG_VM_PGTABLE option. All future changes in here or the debug
test need to be in sync.

PTE helper

15-78
PTE helper semantics
Helper기대 semantics
`pte_same`두 PTE entry가 같은지 검사합니다.
`pte_present`유효하게 mapping된 PTE인지 검사합니다.
`pte_young`Young PTE인지 검사합니다.
`pte_dirty`Dirty PTE인지 검사합니다.
`pte_write`Writable PTE인지 검사합니다.
`pte_special`Special PTE인지 검사합니다.
`pte_protnone``PROT_NONE` PTE인지 검사합니다.
`pte_soft_dirty`Soft-dirty PTE인지 검사합니다.
`pte_swp_soft_dirty`Soft-dirty swapped PTE인지 검사합니다.
`pte_mkyoung`Young PTE를 만듭니다.
`pte_mkold`Old PTE를 만듭니다.
`pte_mkdirty`Dirty PTE를 만듭니다.
`pte_mkclean`Clean PTE를 만듭니다.
`pte_mkwrite`VMA가 지정한 type의 writable PTE를 만듭니다.
`pte_mkwrite_novma`일반 writable type의 PTE를 만듭니다.
`pte_wrprotect`Write-protected PTE를 만듭니다.
`pte_mkspecial`Special PTE를 만듭니다.
`pte_mksoft_dirty`Soft-dirty PTE를 만듭니다.
`pte_clear_soft_dirty`PTE의 soft-dirty를 clear합니다.
`pte_swp_mksoft_dirty`Soft-dirty swapped PTE를 만듭니다.
`pte_swp_clear_soft_dirty`Swapped PTE의 soft-dirty를 clear합니다.
`pte_mknotpresent`Mapping된 PTE를 invalidate합니다.
`ptep_clear`PTE를 clear합니다.
`ptep_get_and_clear`PTE를 clear하고 이전 값을 반환합니다.
`ptep_get_and_clear_full`Batched PTE unmap에서 PTE를 clear하고 반환합니다.
`ptep_test_and_clear_young`PTE의 young bit를 검사하고 clear합니다.
`ptep_set_wrprotect`PTE를 write-protected로 바꿉니다.
`ptep_set_access_flags`PTE를 더 permissive한 상태로 바꿉니다.

PTE 상태 검사, 속성 생성·제거, pointer 기반 atomic update의 공통 의미입니다.

PTE Page Table Helpers
======================

+---------------------------+--------------------------------------------------+
| pte_same                  | Tests whether both PTE entries are the same      |
+---------------------------+--------------------------------------------------+
| pte_present               | Tests a valid mapped PTE                         |
+---------------------------+--------------------------------------------------+
| pte_young                 | Tests a young PTE                                |
+---------------------------+--------------------------------------------------+
| pte_dirty                 | Tests a dirty PTE                                |
+---------------------------+--------------------------------------------------+
| pte_write                 | Tests a writable PTE                             |
+---------------------------+--------------------------------------------------+
| pte_special               | Tests a special PTE                              |
+---------------------------+--------------------------------------------------+
| pte_protnone              | Tests a PROT_NONE PTE                            |
+---------------------------+--------------------------------------------------+
| pte_soft_dirty            | Tests a soft dirty PTE                           |
+---------------------------+--------------------------------------------------+
| pte_swp_soft_dirty        | Tests a soft dirty swapped PTE                   |
+---------------------------+--------------------------------------------------+
| pte_mkyoung               | Creates a young PTE                              |
+---------------------------+--------------------------------------------------+
| pte_mkold                 | Creates an old PTE                               |
+---------------------------+--------------------------------------------------+
| pte_mkdirty               | Creates a dirty PTE                              |
+---------------------------+--------------------------------------------------+
| pte_mkclean               | Creates a clean PTE                              |
+---------------------------+--------------------------------------------------+
| pte_mkwrite               | Creates a writable PTE of the type specified by  |
|                           | the VMA.                                         |
+---------------------------+--------------------------------------------------+
| pte_mkwrite_novma         | Creates a writable PTE, of the conventional type |
|                           | of writable.                                     |
+---------------------------+--------------------------------------------------+
| pte_wrprotect             | Creates a write protected PTE                    |
+---------------------------+--------------------------------------------------+
| pte_mkspecial             | Creates a special PTE                            |
+---------------------------+--------------------------------------------------+
| pte_mksoft_dirty          | Creates a soft dirty PTE                         |
+---------------------------+--------------------------------------------------+
| pte_clear_soft_dirty      | Clears a soft dirty PTE                          |
+---------------------------+--------------------------------------------------+
| pte_swp_mksoft_dirty      | Creates a soft dirty swapped PTE                 |
+---------------------------+--------------------------------------------------+
| pte_swp_clear_soft_dirty  | Clears a soft dirty swapped PTE                  |
+---------------------------+--------------------------------------------------+
| pte_mknotpresent          | Invalidates a mapped PTE                         |
+---------------------------+--------------------------------------------------+
| ptep_clear                | Clears a PTE                                     |
+---------------------------+--------------------------------------------------+
| ptep_get_and_clear        | Clears and returns PTE                           |
+---------------------------+--------------------------------------------------+
| ptep_get_and_clear_full   | Clears and returns PTE (batched PTE unmap)       |
+---------------------------+--------------------------------------------------+
| ptep_test_and_clear_young | Clears young from a PTE                          |
+---------------------------+--------------------------------------------------+
| ptep_set_wrprotect        | Converts into a write protected PTE              |
+---------------------------+--------------------------------------------------+
| ptep_set_access_flags     | Converts into a more permissive PTE              |
+---------------------------+--------------------------------------------------+

PMD helper

79-151
PMD helper semantics
Helper기대 semantics
`pmd_same`두 PMD entry가 같은지 검사합니다.
`pmd_bad`Table이 아닌 mapping의 PMD인지 검사합니다.
`pmd_leaf`Leaf mapping PMD인지 검사합니다.
`pmd_trans_huge`PMD level Transparent Huge Page(THP)인지 검사합니다.
`pmd_present``pmd_page()`가 유효한 memory를 가리키는지 검사합니다.
`pmd_young`Young PMD인지 검사합니다.
`pmd_dirty`Dirty PMD인지 검사합니다.
`pmd_write`Writable PMD인지 검사합니다.
`pmd_special`Special PMD인지 검사합니다.
`pmd_protnone``PROT_NONE` PMD인지 검사합니다.
`pmd_soft_dirty`Soft-dirty PMD인지 검사합니다.
`pmd_swp_soft_dirty`Soft-dirty swapped PMD인지 검사합니다.
`pmd_mkyoung`Young PMD를 만듭니다.
`pmd_mkold`Old PMD를 만듭니다.
`pmd_mkdirty`Dirty PMD를 만듭니다.
`pmd_mkclean`Clean PMD를 만듭니다.
`pmd_mkwrite`VMA가 지정한 type의 writable PMD를 만듭니다.
`pmd_mkwrite_novma`일반 writable type의 PMD를 만듭니다.
`pmd_wrprotect`Write-protected PMD를 만듭니다.
`pmd_mkspecial`Special PMD를 만듭니다.
`pmd_mksoft_dirty`Soft-dirty PMD를 만듭니다.
`pmd_clear_soft_dirty`PMD의 soft-dirty를 clear합니다.
`pmd_swp_mksoft_dirty`Soft-dirty swapped PMD를 만듭니다.
`pmd_swp_clear_soft_dirty`Swapped PMD의 soft-dirty를 clear합니다.
`pmd_mkinvalid`Present PMD를 invalidate합니다. Non-present PMD에는 호출하지 않습니다 [1].
`pmd_set_huge`PMD huge mapping을 만듭니다.
`pmd_clear_huge`PMD huge mapping을 clear합니다.
`pmdp_get_and_clear`PMD를 clear하고 반환합니다.
`pmdp_get_and_clear_full`PMD를 clear하고 반환합니다.
`pmdp_test_and_clear_young`PMD의 young bit를 검사하고 clear합니다.
`pmdp_set_wrprotect`PMD를 write-protected로 바꿉니다.
`pmdp_set_access_flags`PMD를 더 permissive한 상태로 바꿉니다.

PMD의 table·leaf·THP 상태와 permission, huge mapping update 의미입니다.

PMD Page Table Helpers
======================

+---------------------------+--------------------------------------------------+
| pmd_same                  | Tests whether both PMD entries are the same      |
+---------------------------+--------------------------------------------------+
| pmd_bad                   | Tests a non-table mapped PMD                     |
+---------------------------+--------------------------------------------------+
| pmd_leaf                  | Tests a leaf mapped PMD                          |
+---------------------------+--------------------------------------------------+
| pmd_trans_huge            | Tests a Transparent Huge Page (THP) at PMD       |
+---------------------------+--------------------------------------------------+
| pmd_present               | Tests whether pmd_page() points to valid memory  |
+---------------------------+--------------------------------------------------+
| pmd_young                 | Tests a young PMD                                |
+---------------------------+--------------------------------------------------+
| pmd_dirty                 | Tests a dirty PMD                                |
+---------------------------+--------------------------------------------------+
| pmd_write                 | Tests a writable PMD                             |
+---------------------------+--------------------------------------------------+
| pmd_special               | Tests a special PMD                              |
+---------------------------+--------------------------------------------------+
| pmd_protnone              | Tests a PROT_NONE PMD                            |
+---------------------------+--------------------------------------------------+
| pmd_soft_dirty            | Tests a soft dirty PMD                           |
+---------------------------+--------------------------------------------------+
| pmd_swp_soft_dirty        | Tests a soft dirty swapped PMD                   |
+---------------------------+--------------------------------------------------+
| pmd_mkyoung               | Creates a young PMD                              |
+---------------------------+--------------------------------------------------+
| pmd_mkold                 | Creates an old PMD                               |
+---------------------------+--------------------------------------------------+
| pmd_mkdirty               | Creates a dirty PMD                              |
+---------------------------+--------------------------------------------------+
| pmd_mkclean               | Creates a clean PMD                              |
+---------------------------+--------------------------------------------------+
| pmd_mkwrite               | Creates a writable PMD of the type specified by  |
|                           | the VMA.                                         |
+---------------------------+--------------------------------------------------+
| pmd_mkwrite_novma         | Creates a writable PMD, of the conventional type |
|                           | of writable.                                     |
+---------------------------+--------------------------------------------------+
| pmd_wrprotect             | Creates a write protected PMD                    |
+---------------------------+--------------------------------------------------+
| pmd_mkspecial             | Creates a special PMD                            |
+---------------------------+--------------------------------------------------+
| pmd_mksoft_dirty          | Creates a soft dirty PMD                         |
+---------------------------+--------------------------------------------------+
| pmd_clear_soft_dirty      | Clears a soft dirty PMD                          |
+---------------------------+--------------------------------------------------+
| pmd_swp_mksoft_dirty      | Creates a soft dirty swapped PMD                 |
+---------------------------+--------------------------------------------------+
| pmd_swp_clear_soft_dirty  | Clears a soft dirty swapped PMD                  |
+---------------------------+--------------------------------------------------+
| pmd_mkinvalid             | Invalidates a present PMD; do not call for       |
|                           | non-present PMD [1]                              |
+---------------------------+--------------------------------------------------+
| pmd_set_huge              | Creates a PMD huge mapping                       |
+---------------------------+--------------------------------------------------+
| pmd_clear_huge            | Clears a PMD huge mapping                        |
+---------------------------+--------------------------------------------------+
| pmdp_get_and_clear        | Clears a PMD                                     |
+---------------------------+--------------------------------------------------+
| pmdp_get_and_clear_full   | Clears a PMD                                     |
+---------------------------+--------------------------------------------------+
| pmdp_test_and_clear_young | Clears young from a PMD                          |
+---------------------------+--------------------------------------------------+
| pmdp_set_wrprotect        | Converts into a write protected PMD              |
+---------------------------+--------------------------------------------------+
| pmdp_set_access_flags     | Converts into a more permissive PMD              |
+---------------------------+--------------------------------------------------+

PUD helper

152-202
PUD helper semantics
Helper기대 semantics
`pud_same`두 PUD entry가 같은지 검사합니다.
`pud_bad`Table이 아닌 mapping의 PUD인지 검사합니다.
`pud_leaf`Leaf mapping PUD인지 검사합니다.
`pud_trans_huge`PUD level Transparent Huge Page(THP)인지 검사합니다.
`pud_present`유효하게 mapping된 PUD인지 검사합니다.
`pud_young`Young PUD인지 검사합니다.
`pud_dirty`Dirty PUD인지 검사합니다.
`pud_write`Writable PUD인지 검사합니다.
`pud_mkyoung`Young PUD를 만듭니다.
`pud_mkold`Old PUD를 만듭니다.
`pud_mkdirty`Dirty PUD를 만듭니다.
`pud_mkclean`Clean PUD를 만듭니다.
`pud_mkwrite`Writable PUD를 만듭니다.
`pud_wrprotect`Write-protected PUD를 만듭니다.
`pud_mkinvalid`Present PUD를 invalidate합니다. Non-present PUD에는 호출하지 않습니다 [1].
`pud_set_huge`PUD huge mapping을 만듭니다.
`pud_clear_huge`PUD huge mapping을 clear합니다.
`pudp_get_and_clear`PUD를 clear하고 반환합니다.
`pudp_get_and_clear_full`PUD를 clear하고 반환합니다.
`pudp_test_and_clear_young`PUD의 young bit를 검사하고 clear합니다.
`pudp_set_wrprotect`PUD를 write-protected로 바꿉니다.
`pudp_set_access_flags`PUD를 더 permissive한 상태로 바꿉니다.

PUD의 table·leaf·THP 상태, permission과 huge mapping update 의미입니다.

PUD Page Table Helpers
======================

+---------------------------+--------------------------------------------------+
| pud_same                  | Tests whether both PUD entries are the same      |
+---------------------------+--------------------------------------------------+
| pud_bad                   | Tests a non-table mapped PUD                     |
+---------------------------+--------------------------------------------------+
| pud_leaf                  | Tests a leaf mapped PUD                          |
+---------------------------+--------------------------------------------------+
| pud_trans_huge            | Tests a Transparent Huge Page (THP) at PUD       |
+---------------------------+--------------------------------------------------+
| pud_present               | Tests a valid mapped PUD                         |
+---------------------------+--------------------------------------------------+
| pud_young                 | Tests a young PUD                                |
+---------------------------+--------------------------------------------------+
| pud_dirty                 | Tests a dirty PUD                                |
+---------------------------+--------------------------------------------------+
| pud_write                 | Tests a writable PUD                             |
+---------------------------+--------------------------------------------------+
| pud_mkyoung               | Creates a young PUD                              |
+---------------------------+--------------------------------------------------+
| pud_mkold                 | Creates an old PUD                               |
+---------------------------+--------------------------------------------------+
| pud_mkdirty               | Creates a dirty PUD                              |
+---------------------------+--------------------------------------------------+
| pud_mkclean               | Creates a clean PUD                              |
+---------------------------+--------------------------------------------------+
| pud_mkwrite               | Creates a writable PUD                           |
+---------------------------+--------------------------------------------------+
| pud_wrprotect             | Creates a write protected PUD                    |
+---------------------------+--------------------------------------------------+
| pud_mkinvalid             | Invalidates a present PUD; do not call for       |
|                           | non-present PUD [1]                              |
+---------------------------+--------------------------------------------------+
| pud_set_huge              | Creates a PUD huge mapping                       |
+---------------------------+--------------------------------------------------+
| pud_clear_huge            | Clears a PUD huge mapping                        |
+---------------------------+--------------------------------------------------+
| pudp_get_and_clear        | Clears a PUD                                     |
+---------------------------+--------------------------------------------------+
| pudp_get_and_clear_full   | Clears a PUD                                     |
+---------------------------+--------------------------------------------------+
| pudp_test_and_clear_young | Clears young from a PUD                          |
+---------------------------+--------------------------------------------------+
| pudp_set_wrprotect        | Converts into a write protected PUD              |
+---------------------------+--------------------------------------------------+
| pudp_set_access_flags     | Converts into a more permissive PUD              |
+---------------------------+--------------------------------------------------+

HugeTLB helper

203-228
HugeTLB helper semantics
Helper기대 semantics
`pte_huge`HugeTLB인지 검사합니다.
`arch_make_huge_pte`HugeTLB entry를 만듭니다.
`huge_pte_dirty`Dirty HugeTLB인지 검사합니다.
`huge_pte_write`Writable HugeTLB인지 검사합니다.
`huge_pte_mkdirty`Dirty HugeTLB를 만듭니다.
`huge_pte_mkwrite`Writable HugeTLB를 만듭니다.
`huge_pte_wrprotect`Write-protected HugeTLB를 만듭니다.
`huge_ptep_get_and_clear`HugeTLB entry를 clear하고 반환합니다.
`huge_ptep_set_wrprotect`HugeTLB를 write-protected로 바꿉니다.
`huge_ptep_set_access_flags`HugeTLB를 더 permissive한 상태로 바꿉니다.

HugeTLB entry 검사와 dirty·write·access attribute update 의미입니다.

HugeTLB Page Table Helpers
==========================

+---------------------------+--------------------------------------------------+
| pte_huge                  | Tests a HugeTLB                                  |
+---------------------------+--------------------------------------------------+
| arch_make_huge_pte        | Creates a HugeTLB                                |
+---------------------------+--------------------------------------------------+
| huge_pte_dirty            | Tests a dirty HugeTLB                            |
+---------------------------+--------------------------------------------------+
| huge_pte_write            | Tests a writable HugeTLB                         |
+---------------------------+--------------------------------------------------+
| huge_pte_mkdirty          | Creates a dirty HugeTLB                          |
+---------------------------+--------------------------------------------------+
| huge_pte_mkwrite          | Creates a writable HugeTLB                       |
+---------------------------+--------------------------------------------------+
| huge_pte_wrprotect        | Creates a write protected HugeTLB                |
+---------------------------+--------------------------------------------------+
| huge_ptep_get_and_clear   | Clears a HugeTLB                                 |
+---------------------------+--------------------------------------------------+
| huge_ptep_set_wrprotect   | Converts into a write protected HugeTLB          |
+---------------------------+--------------------------------------------------+
| huge_ptep_set_access_flags  | Converts into a more permissive HugeTLB        |
+---------------------------+--------------------------------------------------+

SWAP helper

229-249
SWAP helper semantics
Helper기대 semantics
`__pte_to_swp_entry`Swap PTE에서 architecture `swp_entry_t`를 만듭니다.
`__swp_entry_to_pte`Architecture `swp_entry_t`에서 swap PTE를 만듭니다.
`__pmd_to_swp_entry`Swap PMD에서 architecture `swp_entry_t`를 만듭니다.
`__swp_entry_to_pmd`Architecture `swp_entry_t`에서 swap PMD를 만듭니다.
`is_migration_entry`Read 또는 write migration swapped entry인지 검사합니다.
`is_writable_migration_entry`Write migration swapped entry인지 검사합니다.
`make_readable_migration_entry`Read migration swapped entry를 만듭니다.
`make_writable_migration_entry`Write migration swapped entry를 만듭니다.

PTE·PMD와 swp_entry_t 변환, migration entry 검사·생성 의미입니다.

SWAP Page Table Helpers
========================

+---------------------------+--------------------------------------------------+
| __pte_to_swp_entry        | Creates a swp_entry_t (arch) from a swap PTE     |
+---------------------------+--------------------------------------------------+
| __swp_entry_to_pte        | Creates a swap PTE from a swp_entry_t (arch)     |
+---------------------------+--------------------------------------------------+
| __pmd_to_swp_entry        | Creates a swp_entry_t (arch) from a swap PMD     |
+---------------------------+--------------------------------------------------+
| __swp_entry_to_pmd        | Creates a swap PMD from a swp_entry_t (arch)     |
+---------------------------+--------------------------------------------------+
| is_migration_entry        | Tests a migration (read or write) swapped entry  |
+-------------------------------+----------------------------------------------+
| is_writable_migration_entry   | Tests a write migration swapped entry        |
+-------------------------------+----------------------------------------------+
| make_readable_migration_entry | Creates a read migration swapped entry       |
+-------------------------------+----------------------------------------------+
| make_writable_migration_entry | Creates a write migration swapped entry      |
+-------------------------------+----------------------------------------------+

`mkinvalid` reference

250-250

`pmd_mkinvalid`와 `pud_mkinvalid`의 present-entry 제한에 관한 reference는 `https://lore.kernel.org/linux-mm/20181017020930.GN30832@redhat.com/`입니다.

[1] https://lore.kernel.org/linux-mm/20181017020930.GN30832@redhat.com/