From ae92bdc7f6a0e1556cc11a1624ba458fc9927612 Mon Sep 17 00:00:00 2001 From: Lichen Liu Date: Fri, 6 Jun 2025 11:14:17 +0800 Subject: [PATCH] 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 --- crashkernel-howto.txt | 2 +- kdump-lib.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crashkernel-howto.txt b/crashkernel-howto.txt index dfbe7a7..6c66ee7 100644 --- a/crashkernel-howto.txt +++ b/crashkernel-howto.txt @@ -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. diff --git a/kdump-lib.sh b/kdump-lib.sh index 8a51722..f31fc3e 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -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