kdump-lib.sh: Reserve crashkernel by default for systems with 1G-2G memory

Resolves: RHEL-91274
Upstream: rhel-only

In the previous commit (3053d959), we adjusted the default value of
crashkernel, this action changed the default behavior of RHEL-9.
Systems with less than 2G memory will not be able to start kdump by
default. This is a breaking change on small VMs that only use local
dump.

In order to keep compatibility, reserve crashkernel for systems with
1G-2G memory on RHEL-9.

Fixes: 3053d959 ("kdump-lib.sh: Adjust default crashkernel reservation for x86_64 and s390x")

Signed-off-by: Lichen Liu <lichliu@redhat.com>
This commit is contained in:
Lichen Liu 2025-06-06 11:14:17 +08:00
parent ef34556f8c
commit ae92bdc7f6
No known key found for this signature in database
GPG Key ID: 2ED8215EF57B3D6C
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ Latest kexec-tools provides "kdumpctl get-default-crashkernel" to retrieve
the default crashkernel value,
$ echo $(kdumpctl get-default-crashkernel)
2G-64G:256M,64G-:512M
1G-2G:192M,2G-64G:256M,64G-:512M
It will be taken as the default value of 'crashkernel=', you can use
this value as a reference for setting crashkernel value manually.

View File

@ -1156,13 +1156,13 @@ kdump_get_arch_recommend_crashkernel()
_arch=$(uname -m)
if [[ $_arch == "x86_64" ]] || [[ $_arch == "s390x" ]]; then
_ck_cmdline="2G-64G:256M,64G-:512M"
_ck_cmdline="1G-2G:192M,2G-64G:256M,64G-:512M"
is_sme_or_sev_active && ((_delta += 64))
elif [[ $_arch == "aarch64" ]]; then
local _running_kernel
# Base line for 4K variant kernel. The formula is based on x86 plus extra = 64M
_ck_cmdline="2G-4G:256M,4G-64G:320M,64G-:576M"
_ck_cmdline="1G-4G:256M,4G-64G:320M,64G-:576M"
if [[ -z "$2" ]]; then
_running_kernel=$(_get_kdump_kernel_version)
else