kdump-lib.sh: rounded up the total_mem to 128M in get_system_size
Resolves: RHEL-83645 Upstream: kdump-utils commit 18fc5b7e7b89ee3caba04ce18bf32036aa19da6e Author: Lichen Liu <lichliu@redhat.com> Date: Fri Mar 7 12:22:05 2025 +0800 kdump-lib.sh: rounded up the total_mem to 128M in get_system_size 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); This patch is aimed to align with the kernel's behavior. A machine showing 4000MB of total memory will be treated as having 4G instead of 3G memory. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2306493 Signed-off-by: Lichen Liu <lichliu@redhat.com> Signed-off-by: Lichen Liu <lichliu@redhat.com>
This commit is contained in:
parent
3053d95923
commit
97ec3f19c1
@ -949,8 +949,11 @@ PROC_IOMEM=/proc/iomem
|
||||
#get system memory size i.e. memblock.memory.total_size in the unit of GB
|
||||
get_system_size()
|
||||
{
|
||||
sum=$(sed -n "s/\s*\([0-9a-fA-F]\+\)-\([0-9a-fA-F]\+\) : System RAM$/+ 0x\2 - 0x\1 + 1/p" $PROC_IOMEM)
|
||||
echo $(( (sum) / 1024 / 1024 / 1024))
|
||||
local _mem_size_mb _sum
|
||||
_sum=$(sed -n "s/\s*\([0-9a-fA-F]\+\)-\([0-9a-fA-F]\+\) : System RAM$/+ 0x\2 - 0x\1 + 1/p" $PROC_IOMEM)
|
||||
_mem_size_mb=$(( (_sum) / 1024 / 1024 ))
|
||||
# rounding up the total_size to 128M to align with kernel code kernel/crash_reserve.c
|
||||
echo $(((_mem_size_mb + 127) / 128 * 128 / 1024 ))
|
||||
}
|
||||
|
||||
# Return the recommended size for the reserved crashkernel memory
|
||||
|
Loading…
Reference in New Issue
Block a user