← Documents Documentation/core-api/boot-time-mm.rst GitHub 원문 ↗

Linux 6.18.37 · Core API

Boot time memory management

정상 메모리 관리가 준비되기 전 memblock을 설정하고, 초기 자료 구조를 할당하며, NUMA node와 실패 정책을 선택하는 부팅 시점 메모리 관리 API를 설명합니다.

Source pathDocumentation/core-api/boot-time-mm.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

boot-time-mm.rst:1-41

커널은 physical page allocator 자체를 준비하기 위해서도 먼저 메모리가 필요합니다. `memblock`은 이 순환 의존성을 풀기 위해 아주 이른 부팅 단계에서 동작하는 전용 allocator입니다.

architecture 코드는 `setup_arch`에서 memblock을 구성하고 `mem_init`에서 초기 메모리 관리 단계를 끝냅니다. 그 사이에는 node 지정 여부와 할당 실패 시 panic 여부에 따라 적절한 API variant를 선택합니다.

상세 API는 `include/linux/memblock.h`와 `mm/memblock.c`의 kernel-doc에서 생성되므로, 선언부와 구현부의 문서가 이 페이지의 함수 및 구조체 참조를 이룹니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ===========================
2 Boot time memory management
3 ===========================
4
5 Early system initialization cannot use "normal" memory management
6 simply because it is not set up yet. But there is still need to
7 allocate memory for various data structures, for instance for the
8 physical page allocator.
9
10 A specialized allocator called ``memblock`` performs the
11 boot time memory management. The architecture specific initialization
12 must set it up in :c:func:`setup_arch` and tear it down in
13 :c:func:`mem_init` functions.
14
15 Once the early memory management is available it offers a variety of
16 functions and macros for memory allocations. The allocation request
17 may be directed to the first (and probably the only) node or to a
18 particular node in a NUMA system. There are API variants that panic
19 when an allocation fails and those that don't.
20
21 Memblock also offers a variety of APIs that control its own behaviour.
22
23 Memblock Overview
24 =================
25
26 .. kernel-doc:: mm/memblock.c
27 :doc: memblock overview
28
29
30 Functions and structures
31 ========================
32
33 Here is the description of memblock data structures, functions and
34 macros. Some of them are actually internal, but since they are
35 documented it would be silly to omit them. Besides, reading the
36 descriptions for the internal functions can help to understand what
37 really happens under the hood.
38
39 .. kernel-doc:: include/linux/memblock.h
40 .. kernel-doc:: mm/memblock.c
41 :functions:
42

3. 한국어 전문 번역

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

Boot time memory management(부팅 시점 메모리 관리)

1-4

이 문서는 정상적인 메모리 관리가 준비되기 전의 초기 부팅 단계에서 사용하는 메모리 관리 방식을 설명합니다.

초기 메모리 할당과 memblock

5-14

시스템 초기화 초반에는 "normal" memory management가 아직 설정되지 않았으므로 이를 사용할 수 없습니다. 하지만 physical page allocator를 비롯한 여러 자료 구조를 위해 메모리를 할당할 필요는 여전히 있습니다.

부팅 시점 메모리 관리는 `memblock`이라는 특수 allocator가 담당합니다. architecture-specific 초기화 코드는 `setup_arch`에서 이를 설정하고 `mem_init` 함수에서 해제해야 합니다.

할당 API와 동작 제어

15-22

초기 메모리 관리가 준비되면 메모리 할당을 위한 여러 함수와 macro를 사용할 수 있습니다. 할당 요청은 첫 번째 node, 즉 대개 유일한 node로 보낼 수도 있고 NUMA 시스템의 특정 node로 보낼 수도 있습니다.

할당 실패 시 panic을 일으키는 API variant와 panic을 일으키지 않는 variant가 모두 제공됩니다. Memblock은 자체 동작을 제어하는 여러 API도 제공합니다.

Memblock Overview

23-29

`mm/memblock.c`의 kernel-doc에서 `memblock overview` 문서를 가져와 memblock의 전체 구조와 역할을 설명합니다.

.. kernel-doc:: mm/memblock.c
   :doc: memblock overview

Functions and structures(함수와 구조체)

30-41

여기서는 memblock 자료 구조, 함수, macro를 설명합니다. 이들 가운데 일부는 실제로 internal API이지만 이미 문서화되어 있으므로 제외하지 않습니다. internal 함수의 설명을 읽으면 내부에서 실제로 어떤 일이 일어나는지 이해하는 데도 도움이 됩니다.

`include/linux/memblock.h`와 `mm/memblock.c`의 kernel-doc를 포함하며, `:functions:` 옵션으로 함수 문서를 수록합니다.

.. kernel-doc:: include/linux/memblock.h
.. kernel-doc:: mm/memblock.c
   :functions: