Re: [PATCH 09/12] mm/sparse: remove SECTION_MARKED_PRESENT
From: Seongjun Hong
Date: Mon Sep 21 2026 - 12:49:13 EST
Hi David,
I'm sorry for the delayed response.
On Thu, Sep 10, 2026 at 05:11:36PM +0200, David Hildenbrand (Arm) wrote:
> >> +++ b/scripts/gdb/linux/mm.py
> >> @@ -76,7 +76,7 @@ class x86_page_ops():
> >> self.SECTION_IS_EARLY = 1 << int(gdb.parse_and_eval('SECTION_IS_EARLY_BIT'))
> >> except:
> >> self.SECTION_HAS_MEM_MAP = 1 << 0
> >> - self.SECTION_IS_EARLY = 1 << 3
> >> + self.SECTION_IS_EARLY = 1 << 2
> >
> > Seems a bit strage given the code is:
> >
> > try:
> > self.SECTION_HAS_MEM_MAP = 1 << int(gdb.parse_and_eval('SECTION_HAS_MEM_MAP_BIT'))
> > self.SECTION_IS_EARLY = 1 << int(gdb.parse_and_eval('SECTION_IS_EARLY_BIT'))
> > except:
> > self.SECTION_HAS_MEM_MAP = 1 << 0
> > self.SECTION_IS_EARLY = 1 << 2
> >
> > Whereas other variables must be available with no try, e.g.:
> >
> > self.PAGE_OFFSET = int(gdb.parse_and_eval("page_offset_base"))
> > self.VMEMMAP_START = int(gdb.parse_and_eval("vmemmap_base"))
> > self.PHYS_BASE = int(gdb.parse_and_eval("(unsigned long) phys_base"))
> >
> > etc.
> >
> > Is there some weirdness with gdb? Or is it maybe because there are some configs
> > without these symbols maybe?
>
> TBH, I have absolutely no idea and I was asking myself the same thing (but
> decided that I couldn't care less about a python gdb script).
>
> This code was added in February:
>
> commit 55f8b4518d14b7436f70defe27faba4eca0cd4e1
> Author: Seongjun Hong <hsj0512@xxxxxxxxx>
> Date: Mon Feb 2 12:42:41 2026 +0900
>
> scripts/gdb: implement x86_page_ops in mm.py
>
> Implement all member functions of x86_page_ops strictly following the
> logic of aarch64_page_ops.
>
> This includes full support for SPARSEMEM and standard page translation
> functions.
>
> This fixes compatibility with 'lx-' commands on x86_64, preventing
> AttributeErrors when using lx-pfn_to_page and others.
>
> @Seongjun, why are these conditional and the others not? Trying to support older
> kernels?
No. TBH I didn't look at the gdb script carefully at that time and just
wanted to avoid a symbol lookup failure.
It would be better if we remove the try statement.
Thanks! :)
--
Best regards,
Seongjun Hong