Bug 2306493 - get_recommend_size isn't consistent with the kernel
Summary: get_recommend_size isn't consistent with the kernel
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: kdump-utils
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Lichen Liu
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-08-21 09:20 UTC by Coiby
Modified: 2025-04-01 07:58 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-04-01 07:58:14 UTC
Type: ---
Embargoed:
ruyang: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FC-1480 0 None None None 2025-02-17 09:38:06 UTC

Description Coiby 2024-08-21 09:20:02 UTC
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

Comment 1 Dave Young 2025-02-17 09:36:02 UTC
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.

Comment 2 Aoife Moloney 2025-02-26 13:11:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.


Note You need to log in before you can comment on or make changes to this bug.