Skip to content

Commit c0c5a6d

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, SME). So we skip that case. Signed-off-by: Pingfan Liu <[email protected]>
1 parent 2b6f34b commit c0c5a6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kdump-lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ kdump_get_arch_recommend_crashkernel()
10271027
_arch=$(uname -m)
10281028
10291029
if [[ $_arch == "x86_64" ]] || [[ $_arch == "s390x" ]]; then
1030-
_ck_cmdline="2G-64G:256M,64G-:512M"
1030+
_ck_cmdline="2G-4G:256M,4G-64G:256M,64G-:512M"
10311031
is_sme_or_sev_active && ((_delta += 64))
10321032
elif [[ $_arch == "aarch64" ]]; then
10331033
local _running_kernel
@@ -1062,7 +1062,7 @@ kdump_get_arch_recommend_crashkernel()
10621062
fi
10631063
fi
10641064
1065-
echo -n "$(_crashkernel_add "$_ck_cmdline" "${_delta}M")"
1065+
echo -n "$(_crashkernel_add "$_ck_cmdline" "${_delta}M" 1)"
10661066
}
10671067
10681068
# return recommended size based on current system RAM size

0 commit comments

Comments
 (0)