sysconfig: use initramfs_options to reduce memory usage

Resolves: RHEL-105198
Upstream: kdump-utils
Conflict: yes, the gen-kdump-sysconfig.sh was refactored, so we need
to manually modify the KDUMP_COMMANDLINE_APPEND= options.

Signed-off-by: Lichen Liu <lichliu@redhat.com>
This commit is contained in:
Lichen Liu 2026-01-21 11:29:44 +08:00
parent 24edf00fb8
commit 3aa4c426cd
No known key found for this signature in database
GPG Key ID: 2ED8215EF57B3D6C
2 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,80 @@
From 1bfd6e6fe97cd8497bbfb1e1ba76929bd87a9553 Mon Sep 17 00:00:00 2001
From: Lichen Liu <lichliu@redhat.com>
Date: Thu, 4 Dec 2025 13:37:26 +0800
Subject: [PATCH] sysconfig: use initramfs_options to reduce memory usage
Starting with Linux 6.18, Fedora 42, RHEL 10.2, and RHEL 9.8, the
kernel supports the `initramfs_options` boot parameter.
Sets `initramfs_options=size=90%` can increase the size of the tmpfs
used for initramfs decompression from the default 50% to 90% of memory.
This change greatly reduces memory pressure during decompression,
allowing for a reduction in the memory reserved for the crashkernel.
Signed-off-by: Lichen Liu <lichliu@redhat.com>
---
gen-kdump-sysconfig.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/gen-kdump-sysconfig.sh b/gen-kdump-sysconfig.sh
index 53115c1..164fff5 100755
--- a/gen-kdump-sysconfig.sh
+++ b/gen-kdump-sysconfig.sh
@@ -29,7 +29,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swio
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices novmcoredd cma=0 hugetlb_cma=0"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices novmcoredd cma=0 hugetlb_cma=0 initramfs_options=size=90%"
# This variable lets us append arguments to fadump (powerpc) capture kernel,
# further to the parameters passed via the bootloader.
@@ -82,25 +82,25 @@ case "$1" in
aarch64)
update_param KEXEC_ARGS "-s"
update_param KDUMP_COMMANDLINE_APPEND \
- "irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0 kfence.sample_interval=0"
+ "irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0 kfence.sample_interval=0 initramfs_options=size=90%"
;;
i386)
update_param KDUMP_COMMANDLINE_APPEND \
- "irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd cma=0 hugetlb_cma=0 kfence.sample_interval=0"
+ "irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd cma=0 hugetlb_cma=0 kfence.sample_interval=0 initramfs_options=size=90%"
;;
ppc64)
update_param KEXEC_ARGS "--dt-no-old-root"
update_param KDUMP_COMMANDLINE_REMOVE \
"hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
update_param KDUMP_COMMANDLINE_APPEND \
- "irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0 kfence.sample_interval=0"
+ "irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0 kfence.sample_interval=0 initramfs_options=size=90%"
;;
ppc64le)
update_param KEXEC_ARGS "-s"
update_param KDUMP_COMMANDLINE_REMOVE \
"hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
update_param KDUMP_COMMANDLINE_APPEND \
- "irqpoll nr_cpus=16 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0 kfence.sample_interval=0"
+ "irqpoll nr_cpus=16 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0 kfence.sample_interval=0 initramfs_options=size=90%"
update_param FADUMP_COMMANDLINE_APPEND \
"nr_cpus=16 numa=off cgroup_disable=memory cma=0 kvm_cma_resv_ratio=0 hugetlb_cma=0 transparent_hugepage=never novmcoredd udev.children-max=2"
;;
@@ -109,12 +109,12 @@ s390x)
update_param KDUMP_COMMANDLINE_REMOVE \
"hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot zfcp.allow_lun_scan"
update_param KDUMP_COMMANDLINE_APPEND \
- "nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd vmcp_cma=0 cma=0 hugetlb_cma=0 kfence.sample_interval=0"
+ "nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd vmcp_cma=0 cma=0 hugetlb_cma=0 kfence.sample_interval=0 initramfs_options=size=90%"
;;
x86_64)
update_param KEXEC_ARGS "-s"
update_param KDUMP_COMMANDLINE_APPEND \
- "irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0 pcie_ports=compat kfence.sample_interval=0"
+ "irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0 pcie_ports=compat kfence.sample_interval=0 initramfs_options=size=90%"
;;
*)
echo "Warning: Unknown architecture '$1', using default sysconfig template." >&2
--
2.52.0

View File

@ -23,6 +23,7 @@ Patch12: 0012-powerpc-consider-CPU-count-while-calculating-crashke.patch
Patch13: 0013-powerpc-Set-nr_cpus-16-for-kdump-kernel.patch
Patch14: 0014-kexec-kdump-howto.txt-update-paragraphs-related-to-d.patch
Patch15: 0015-kdump-lib-initramfs-Fix-performance-regression-in-kd.patch
Patch16: 0016-sysconfig-use-initramfs_options-to-reduce-memory-usa.patch
%ifarch ppc64 ppc64le