crashkernel memory reservation on arm64¶
Author: Baoquan He <bhe@redhat.com>
Kdump mechanism is used to capture a corrupted kernel vmcore so thatit can be subsequently analyzed. In order to do this, a preliminarilyreserved memory is needed to pre-load the kdump kernel and boot suchkernel if corruption happens.
That reserved memory for kdump is adapted to be able to minimallyaccommodate the kdump kernel and the user space programs needed for thevmcore collection.
Kernel parameter¶
Through the kernel parameters below, memory can be reserved accordinglyduring the early stage of the first kernel booting so that a continuouslarge chunk of memomy can be found. The low memory reservation needs tobe considered if the crashkernel is reserved from the high memory area.
crashkernel=size
crashkernel=size,high crashkernel=size,low
Low memory and high memory¶
For kdump reservations, low memory is the memory area under a specificlimit, usually decided by the accessible address bits of the DMA-capabledevices needed by the kdump kernel to run. Those devices not related tovmcore dumping can be ignored. On arm64, the low memory upper bound isnot fixed: it is 1G on the RPi4 platform but 4G on most other systems.On special kernels built with CONFIG_ZONE_(DMA|DMA32) disabled, thewhole system RAM is low memory. Outside of the low memory describedabove, 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 orfail if already occupied.
2) crashkernel=size¶
The crashkernel memory region will be reserved in any available positionaccording to the search order:
Firstly, the kernel searches the low memory area for an available regionwith the specified size.
If searching for low memory fails, the kernel falls back to searchingthe high memory area for an available region of the specified size. Ifthe reservation in high memory succeeds, a default size reservation inthe 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 kernelreservations. The user would not need to know the system memory layoutfor a specific platform.
3) crashkernel=size,high crashkernel=size,low¶
crashkernel=size,(high|low) are an important supplement tocrashkernel=size. They allows the user to specify how much memory needsto be allocated from the high memory and low memory respectively. Onmany systems the low memory is precious and crashkernel reservationsfrom this area should be kept to a minimum.
To reserve memory for crashkernel=size,high, searching is firstattempted from the high memory region. If the reservation succeeds, thelow memory reservation will be done subsequently.
If reservation from the high memory failed, the kernel falls back tosearching 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 memoryreservation will be done automatically.
if crashkernel=0,low is specified, it means that the low memoryreservation is omitted intentionally.