Fedora Account System
Red Hat Associate
Red Hat Customer
get_recommend_size will return the recommended size for the reserved crashkernel memory depending on the system memory size. It return 0M for a system with 1G RAM. However the kernel reserves 192MB for crash kernel, ``` [root@localhost ~]# cat /proc/cmdline BOOT_IMAGE=(hd0,gpt3)/vmlinuz-6.10.0-0.rc6.50.fc41.x86_64 no_timer_check systemd.firstboot=off root=UUID=310b0c18-e10c-4bdd-8327-8b5b0785769d rootflags=subvol=root console=tty1 console=ttyS 0,115200n8 crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M [root@localhost ~]# kdumpctl showmem kdump: Reserved 192MB memory for crash kernel ``` One consequence is the recommended value is smaller than default reserved value, ``` [root@localhost ~]# kdumpctl estimate Reserved crashkernel: 192M Recommended crashkernel: 161M Kernel image size: 60M Kernel modules size: 3M Initramfs size: 33M Runtime reservation: 64M Large modules: kvm: 1445888 ``` Reproducible: Always Steps to Reproduce: 1. virt-install --ram 1024 PATH_TO_CLOUD_IMAGE 2. dnf install kdump-utils 3. kdumpctl reset-crashkernel 4. reboot 5. bash -x kdumpctl estimate Actual Results: get_recommend_size return 0. Expected Results: get_recommend_size should be consistent with how the kernel interpret crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M
The kernel code to calculate reserving size rounded up the total_mem because usually the memblock usable mem size is smaller than the physical dimm memory size: total_mem = roundup(total_mem, SZ_128M); So if you do a similar change in userspace, it might work for usual cases.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle. Changing version to 42.