Commit Graph

6 Commits

Author SHA1 Message Date
Lichen Liu ae7b4d103e Introduce a function to get reserved memory size
Resolves: bz2235389
Upstream: Fedora Rawhide
Conflict: small change.

commit 4b7b7736ee
Author: Sourabh Jain <sourabhjain@linux.ibm.com>
Date:   Wed Aug 2 20:36:48 2023 +0530

    Introduce a function to get reserved memory size

    The size of the reserved memory in the functions show_reserved_mem,
    check_crash_mem_reserved, and do_estimate are fetched from the sysfs
    node `/sys/kernel/kexec_crash_size`. However, in the case of fadump,
    the reserved area size is instead present in
    /sys/kernel/fadump/mem_reserved.

    For example:

    $ kdumpctl showmem
    kdump: Dump mode is fadump
    kdump: Reserved 0MB memory for crash kernel

    The above command showed 0MB for Reserved memory which is incorrect, the
    actual reservation was 2048MB.

    To resolve this issue a new helper function is introduced to fetch
    reserved memory size based on the dump mode. For "fadump" mode,
    it looks in `/sys/kernel/fadump/mem_reserved`, otherwise, it uses
    `/sys/kernel/kexec_crash_size`. And all functions that previously
    fetching reserved memory directly from `/sys/kernel/kexec_crash_size`
    sysfs node are now updated to use this new function to get the reserved
    memory size.

    With the fix in place, the `kdumpctl showmem` command will now display
    correct reserved memory size.

    $ kdumpctl showmem
    kdump: Dump mode is fadump
    kdump: Reserved 2048MB memory for crash kernel

    Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
    Reported-by: Sachin P Bappalige <sachinpb@linux.vnet.ibm.com>
    Reviewed-by: Coiby Xu <coxu@redhat.com>

Signed-off-by: Lichen Liu <lichliu@redhat.com>
2023-09-22 10:49:51 +08:00
CentOS Sources e89fde4b8b Auto sync2gitlab import of kexec-tools-2.0.25-5.el8.src.rpm 2023-01-20 10:15:07 +00:00
CentOS Sources 482dfd07d3 Auto sync2gitlab import of kexec-tools-2.0.24-7.el8.src.rpm 2022-09-24 10:11:03 +00:00
CentOS Sources 12a2a5b2e3 Auto sync2gitlab import of kexec-tools-2.0.24-2.el8.src.rpm 2022-06-02 14:32:08 +00:00
James Antill b6940b3cfc Auto sync2gitlab import of kexec-tools-2.0.24-1.el8.src.rpm 2022-05-31 14:44:30 -04:00
James Antill d28435b620 Auto sync2gitlab import of kexec-tools-2.0.20-68.el8.src.rpm 2022-05-26 10:04:08 -04:00