Skip to content

Commit 6c8b1ad

Browse files
author
Pingfan Liu
committed
kdump-lib: Skip adding reserved memory for small-memory machine
This increased "crashkernel=" raises the risk of OOM conditions in the production kernel, particularly on small-memory machines that typically lack such hardware features (Mellanox network cards, SMMU). So we skip that case on aarch64. For other arches, the above factors are not considered, so ignore them for the time being. Signed-off-by: Pingfan Liu <[email protected]>
1 parent 350e016 commit 6c8b1ad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kdump-lib.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,7 @@ kdump_get_arch_recommend_crashkernel()
10121012
{
10131013
local _arch _ck_cmdline _dump_mode
10141014
local _delta=0
1015+
local _skip=0
10151016
10161017
if [[ -z $1 ]]; then
10171018
if is_fadump_capable; then
@@ -1038,6 +1039,8 @@ kdump_get_arch_recommend_crashkernel()
10381039
else
10391040
_running_kernel=$2
10401041
fi
1042+
# skip adding additional memory for small-memory machine
1043+
_skip=1
10411044
10421045
# the naming convention of 64k variant suffixes with +64k, e.g. "vmlinuz-5.14.0-312.el9.aarch64+64k"
10431046
if echo "$_running_kernel" | grep -q 64k; then
@@ -1061,7 +1064,7 @@ kdump_get_arch_recommend_crashkernel()
10611064
fi
10621065
fi
10631066
1064-
echo -n "$(_crashkernel_add "$_ck_cmdline" "${_delta}M")"
1067+
echo -n "$(_crashkernel_add "$_ck_cmdline" "${_delta}M" "$_skip")"
10651068
}
10661069
10671070
# return recommended size based on current system RAM size

0 commit comments

Comments
 (0)