From 3053d95923f6d870c7d5932d005c3cca85045cfb Mon Sep 17 00:00:00 2001 From: Lichen Liu Date: Mon, 14 Apr 2025 10:29:14 +0800 Subject: [PATCH] kdump-lib.sh: Adjust default crashkernel reservation for x86_64 and s390x Resolves: RHEL-83645 Upstream: kdump-utils commit fe18f933baed9eaa18e0c2427aaca4640d8f6fa1 Author: Lichen Liu Date: Thu Mar 6 10:21:43 2025 +0800 kdump-lib.sh: Adjust default crashkernel reservation for x86_64 and s390x With new kernel features being added, both the kernel itself and the initramfs have gradually increased in size. Previously, we used squashfs to package and reduce the initramfs size. However, since squashfs will be replaced by erofs, we have transitioned to erofs. The compression algorithms supported by erofs differ from those used in squashfs. In previous squashfs implementations, we used zstd compression, but in RHEL-10, the erofs implementation in the kernel does not yet support zstd decompression. As a result, we had to switch to other compression algorithms, leading to changes in the initramfs size. In some scenarios, the previous 192M crashkernel reservation is no longer sufficient. Recent NFS testing has shown that at least 238M is required to successfully capture a vmcore. Given this, we have updated the default crashkernel reservation to start from 2G, with 256M allocated for crash recovery. Since 256M is a significant portion of memory on smaller systems, we have decided not to reserve crashkernel memory by default on systems with less than 2G of RAM. However, users can still manually adjust the `crashkernel=` setting via tools like `grubby` if needed. Signed-off-by: Lichen Liu 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 54e1141..dfbe7a7 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) - 1G-4G:192M,4G-64G:256M,64G-:512M + 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 5ba7a07..813c580 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -1153,13 +1153,13 @@ kdump_get_arch_recommend_crashkernel() _arch=$(uname -m) if [[ $_arch == "x86_64" ]] || [[ $_arch == "s390x" ]]; then - _ck_cmdline="1G-4G:192M,4G-64G:256M,64G-:512M" + _ck_cmdline="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="1G-4G:256M,4G-64G:320M,64G-:576M" + _ck_cmdline="2G-4G:256M,4G-64G:320M,64G-:576M" if [[ -z "$2" ]]; then _running_kernel=$(_get_kdump_kernel_version) else