Skip to content

Commit d79ce00

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 2b6f34b commit d79ce00

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
@@ -1013,6 +1013,7 @@ kdump_get_arch_recommend_crashkernel()
10131013
{
10141014
local _arch _ck_cmdline _dump_mode
10151015
local _delta=0
1016+
local _skip=0
10161017
10171018
if [[ -z $1 ]]; then
10181019
if is_fadump_capable; then
@@ -1039,6 +1040,8 @@ kdump_get_arch_recommend_crashkernel()
10391040
else
10401041
_running_kernel=$2
10411042
fi
1043+
# skip adding additional memory for small-memory machine
1044+
_skip=1
10421045
10431046
# the naming convention of 64k variant suffixes with +64k, e.g. "vmlinuz-5.14.0-312.el9.aarch64+64k"
10441047
if echo "$_running_kernel" | grep -q 64k; then
@@ -1062,7 +1065,7 @@ kdump_get_arch_recommend_crashkernel()
10621065
fi
10631066
fi
10641067
1065-
echo -n "$(_crashkernel_add "$_ck_cmdline" "${_delta}M")"
1068+
echo -n "$(_crashkernel_add "$_ck_cmdline" "${_delta}M" "$_skip")"
10661069
}
10671070
10681071
# return recommended size based on current system RAM size

0 commit comments

Comments
 (0)