Re: [PATCH] vmcoreinfo: export SECTION_HAS_MEM_MAP
From: Baoquan He
Date: Mon Sep 28 2026 - 06:19:42 EST
On 09/28/26 at 11:14am, David Hildenbrand (Arm) wrote:
> On 9/28/26 11:11, Baoquan He wrote:
> > 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.
>
> I'm not particularly happy about having core-kernel defines documented in
> kdump/vmcoreinfo.rst, though?
>
> If it would be something vmcoreinfo special, sure. But not for basic defines.
>
> "See the kernel source code" is really what anybody using this should be doing?
I can't remember who suggested adding this document. The benefit is
users can read document to understand how it works, no need to look
at the code. I don't have strong preference on this.
So I am fine with both. Or we can add it if anyone really complains.
For the patch itself,
Acked-by: Baoquan He <baoquan.he@xxxxxxxxx>
Thanks
Baoquan