Skip to content

Commit 5d87bfd

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 39519b1 commit 5d87bfd

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
@@ -989,6 +989,7 @@ kdump_get_arch_recommend_crashkernel()
989989
{
990990
local _arch _ck_cmdline _dump_mode
991991
local _delta=0
992+
local _skip=0
992993
993994
if [[ -z $1 ]]; then
994995
if is_fadump_capable; then
@@ -1015,6 +1016,8 @@ kdump_get_arch_recommend_crashkernel()
10151016
else
10161017
_running_kernel=$2
10171018
fi
1019+
# skip adding additional memory for small-memory machine
1020+
_skip=1
10181021
10191022
# the naming convention of 64k variant suffixes with +64k, e.g. "vmlinuz-5.14.0-312.el9.aarch64+64k"
10201023
if echo "$_running_kernel" | grep -q 64k; then
@@ -1038,7 +1041,7 @@ kdump_get_arch_recommend_crashkernel()
10381041
fi
10391042
fi
10401043
1041-
echo -n "$(_crashkernel_add "$_ck_cmdline" "${_delta}M")"
1044+
echo -n "$(_crashkernel_add "$_ck_cmdline" "${_delta}M" "$_skip")"
10421045
}
10431046
10441047
# return recommended size based on current system RAM size

0 commit comments

Comments
 (0)