요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=======================================
crashkernel memory reservation on arm64
=======================================
Author: Baoquan He <bhe@redhat.com>
Kdump mechanism is used to capture a corrupted kernel vmcore so that
it can be subsequently analyzed. In order to do this, a preliminarily
reserved memory is needed to pre-load the kdump kernel and boot such
kernel if corruption happens.
That reserved memory for kdump is adapted to be able to minimally
accommodate the kdump kernel and the user space programs needed for the
vmcore collection.
Kernel parameter
================
Through the kernel parameters below, memory can be reserved accordingly
during the early stage of the first kernel booting so that a continuous
large chunk of memomy can be found. The low memory reservation needs to
be considered if the crashkernel is reserved from the high memory area.
- crashkernel=size@offset
- crashkernel=size
- crashkernel=size,high crashkernel=size,low
Low memory and high memory
==========================
For kdump reservations, low memory is the memory area under a specific
limit, usually decided by the accessible address bits of the DMA-capable
devices needed by the kdump kernel to run. Those devices not related to
vmcore dumping can be ignored. On arm64, the low memory upper bound is
not fixed: it is 1G on the RPi4 platform but 4G on most other systems.
On special kernels built with CONFIG_ZONE_(DMA|DMA32) disabled, the
whole system RAM is low memory. Outside of the low memory described
above, the rest of system RAM is considered high memory.
Implementation
==============
1) crashkernel=size@offset
--------------------------
The crashkernel memory must be reserved at the user-specified region or
fail if already occupied.
2) crashkernel=size
-------------------
The crashkernel memory region will be reserved in any available position
according to the search order:
Firstly, the kernel searches the low memory area for an available region
with the specified size.
If searching for low memory fails, the kernel falls back to searching
the high memory area for an available region of the specified size. If
the reservation in high memory succeeds, a default size reservation in
the low memory will be done. Currently the default size is 128M,
sufficient for the low memory needs of the kdump kernel.
Note: crashkernel=size is the recommended option for crashkernel kernel
reservations. The user would not need to know the system memory layout
for a specific platform.
3) crashkernel=size,high crashkernel=size,low
---------------------------------------------
crashkernel=size,(high|low) are an important supplement to
crashkernel=size. They allows the user to specify how much memory needs
to be allocated from the high memory and low memory respectively. On
many systems the low memory is precious and crashkernel reservations
from this area should be kept to a minimum.
To reserve memory for crashkernel=size,high, searching is first
attempted from the high memory region. If the reservation succeeds, the
low memory reservation will be done subsequently.
If reservation from the high memory failed, the kernel falls back to
searching the low memory with the specified size in crashkernel=,high.
If it succeeds, no further reservation for low memory is needed.
Notes:
- If crashkernel=,low is not specified, the default low memory
reservation will be done automatically.
- if crashkernel=0,low is specified, it means that the low memory
reservation is omitted intentionally.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Kdump 예약 목적
1-15문서 제목은 `crashkernel memory reservation on arm64`, 작성자는 Baoquan He `<bhe@redhat.com>`입니다.
Kdump는 손상된 kernel의 `vmcore`를 수집해 나중에 분석하는 mechanism입니다. 이를 위해 kdump kernel을 미리 load해 두고 corruption 발생 시 boot할 reserved memory가 필요합니다. 예약 크기는 kdump kernel과 vmcore 수집에 필요한 userspace program을 최소한 수용하도록 조정합니다.
Kernel parameter 형식
16-27첫 kernel boot의 이른 단계에서 아래 parameter로 연속된 큰 memory chunk를 예약합니다. Crashkernel을 high memory에서 예약한다면 low-memory 예약도 고려해야 합니다.
| 형식 | 의미 |
|---|---|
| `crashkernel=size@offset` | 지정 offset에 고정 크기를 예약합니다. |
| `crashkernel=size` | Kernel이 low/high memory에서 자동 탐색합니다. |
| `crashkernel=size,high crashkernel=size,low` | High와 low memory의 예약량을 각각 지정합니다. |
Low memory와 high memory
28-39Kdump에서 low memory는 특정 limit 아래 영역입니다. 보통 kdump kernel 실행에 필요한 DMA-capable device의 접근 address bit가 limit을 결정하며 vmcore dump와 무관한 device는 무시할 수 있습니다.
Arm64의 low-memory upper bound는 고정되지 않습니다. RPi4에서는 1G이고 대부분의 다른 system에서는 4G입니다. `CONFIG_ZONE_(DMA|DMA32)`를 끈 특수 kernel에서는 전체 system RAM이 low memory입니다. 이 범위 밖의 나머지 RAM은 high memory로 봅니다.
crashkernel=size@offset
40-49이 형식은 사용자가 지정한 region에 crashkernel memory를 예약해야 하며, 해당 영역이 이미 사용 중이면 실패합니다.
crashkernel=size 자동 탐색
50-68Kernel은 먼저 low-memory 영역에서 지정 크기의 가용 region을 찾습니다. 실패하면 high memory로 fallback합니다. High-memory 예약이 성공하면 low memory에 기본 크기를 추가 예약하며 현재 기본값은 128M으로 kdump kernel의 low-memory 요구에 충분합니다.
`crashkernel=size`는 권장 옵션입니다. 사용자가 platform별 system memory layout을 알 필요가 없습니다.
High·low 크기 개별 지정
69-92`crashkernel=size,(high|low)`는 `crashkernel=size`를 보완하여 high와 low memory에서 각각 얼마나 할당할지 지정합니다. 많은 system에서 low memory는 귀하므로 이 영역의 crashkernel 예약을 최소화해야 합니다.
`crashkernel=size,high`는 high memory를 먼저 찾고 성공하면 이어서 low memory를 예약합니다. High-memory 예약이 실패하면 `crashkernel=,high`에 지정한 크기로 low memory를 탐색하며, 성공하면 추가 low-memory 예약은 필요하지 않습니다.
- `crashkernel=,low`를 지정하지 않으면 기본 low-memory 예약을 자동 수행합니다.
- `crashkernel=0,low`는 low-memory 예약을 의도적으로 생략한다는 뜻입니다.
요약과 해설
kdump.rst:1-92Kdump는 crash 후 별도 kernel을 띄워 vmcore를 수집하므로 boot 초기에 연속 memory를 예약해야 합니다. Arm64에서는 DMA reachability에 따른 low memory가 platform마다 달라 자동 탐색 순서가 중요합니다.
권장 옵션의 low/high fallback과 추가 low-memory 예약 흐름입니다.
고정 위치, 자동 배치, high/low 분리 형식의 차이입니다.