From: Dave Young <ruirui.yang@linux.dev>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <baoquan.he@linux.dev>,
David Carlier <devnexen@gmail.com>, Tao Liu <ltao@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
kexec@lists.infradead.org
Subject: Re: [PATCH] vmcoreinfo: export SECTION_HAS_MEM_MAP
Date: Tue, 29 Sep 2026 08:25:34 +0800 [thread overview]
Message-ID: <a13c01e1-def0-4aa5-b54f-18e523082b29@linux.dev> (raw)
In-Reply-To: <4a57b255-cb38-4e8e-908b-d32e55a1a326@kernel.org>
On 9/28/26 7:42 PM, David Hildenbrand (Arm) wrote:
> On 9/28/26 12:23, Dave Young wrote:
>> On 9/28/26 4:48 PM, 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@kernel.org>
>>> ---
>>> 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@kernel.org
>>> ---
>>> 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);
>>
>> Current crash code looks below:
>> #define SECTION_MARKED_PRESENT (1UL<<0)
>> #define SECTION_HAS_MEM_MAP (1UL<<1)
>> #define SECTION_IS_ONLINE (1UL<<2)
>> #define SECTION_IS_EARLY (1UL<<3)
>> #define SECTION_TAINT_ZONE_DEVICE (1UL<<4)
>> #define SECTION_MAP_LAST_BIT (1UL<<5)
>> #define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1))
>>
>>
>> And it does not match the kernel for below chunk with ifdef
>> #ifdef CONFIG_ZONE_DEVICE
>> SECTION_TAINT_ZONE_DEVICE_BIT,
>> #endif
>> #ifdef CONFIG_SPARSEMEM_VMEMMAP_PREINIT
>> SECTION_IS_VMEMMAP_PREINIT_BIT,
>> #endif
>>
>> The last bit could be wrong in crash. So all numbers should be exported in vmcoreinfo.
>>
>> Thoughts?
>
> You know the crash code best, so likely ... it's time one of the crash people
> takes over this patch?
Rethinking about it I'm hesitating to add many more to vmcoreinfo although it is reasonable, about the #ifdef things, there are other places other than mm, crash can not depend on the /proc/config.gz which is not reliable in the old kernel memory, maybe it will be helpful to export another elf note for old kernel's kconfig. So I'd like to support to use your patch for the time being as the first bit is always needed and leave the remaining concerns a follow up item.
Thanks
Dave
next prev parent reply other threads:[~2026-09-29 0:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 8:48 David Hildenbrand (Arm)
2026-09-28 9:11 ` Baoquan He
2026-09-28 9:14 ` David Hildenbrand (Arm)
2026-09-28 10:12 ` Baoquan He
2026-09-28 10:23 ` Dave Young
2026-09-28 11:42 ` David Hildenbrand (Arm)
2026-09-29 0:25 ` Dave Young [this message]
2026-09-29 2:02 ` HAGIO KAZUHITO(萩尾 一仁)
2026-09-29 6:16 ` David Hildenbrand (Arm)
2026-09-28 15:53 ` Bradley Morgan
2026-09-29 5:05 ` Anshuman Khandual
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a13c01e1-def0-4aa5-b54f-18e523082b29@linux.dev \
--to=ruirui.yang@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=baoquan.he@linux.dev \
--cc=david@kernel.org \
--cc=devnexen@gmail.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ltao@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®