Re: [PATCH] vmcoreinfo: export SECTION_HAS_MEM_MAP

From: Baoquan He

Date: Mon Sep 28 2026 - 05:23:42 EST


On 09/28/26 at 10:48am, David Hildenbrand (Arm) wrote:
> The crash tool currently hardcodes SECTION_HAS_MEM_MAP, and makedumpfile
> needs similar information (although still relying on
> SECTION_MARKED_PRESENT, it should switch to SECTION_HAS_MEM_MAP).
>
> Let's just export the value instead, so tools that work on vmcoreinfo
> will not have to guess.
>
> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> ---
> Result of the discussion in reply to "[PATCH v2 00/13] mm/sparse: remove
> SECTION_MARKED_PRESENT and further cleanups" [1]
>
> This patch can go in independently. It would be preferable if both
> go into the same kernel release ;)
>
> [1] https://lore.kernel.org/r/20260921-b4-sparsemem_cleanups-v2-0-54d81d65e125@xxxxxxxxxx
> ---
> kernel/vmcore_info.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/vmcore_info.c b/kernel/vmcore_info.c
> index 5a417f8a922a..7833a36064a8 100644
> --- a/kernel/vmcore_info.c
> +++ b/kernel/vmcore_info.c
> @@ -182,6 +182,7 @@ static int __init crash_save_vmcoreinfo_init(void)
> VMCOREINFO_STRUCT_SIZE(mem_section);
> VMCOREINFO_OFFSET(mem_section, section_mem_map);
> VMCOREINFO_NUMBER(SECTION_SIZE_BITS);
> + VMCOREINFO_NUMBER(SECTION_HAS_MEM_MAP);
> VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
> #endif
> VMCOREINFO_STRUCT_SIZE(page);

It would be good to add one section in
Documentation/admin-guide/kdump/vmcoreinfo.rst, e.g

SECTION_HAS_MEM_MAP
-------------------

Indicates a memory section has struct page array (mem_map). User-space
tools should read this value but not hardcode it since the bit position
could change between kernel versions.

The code change looks good to me.

>
> ---
>
> base-commit: 57e4ac91fc62d75d84b5a03827a19ceb4094ecd9
>
> change-id: 20260928-section_has_mem_map-6205dc90a09f
>
> --
>
> Cheers,
>
> David
>