Thank you for the fix, Kazu.

On Wed, Jun 18, 2025 at 2:05 PM <devel-request@lists.crash-utility.osci.io> wrote:
Date: Tue, 17 Jun 2025 06:08:52 +0000
From: HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@nec.com>
Subject: [Crash-utility] [PATCH] Fix "kmem -p" option on Linux
        6.16-rc1 and later kernels
To: "devel@lists.crash-utility.osci.io"
        <devel@lists.crash-utility.osci.io>
Message-ID: <1750140529-10427-1-git-send-email-k-hagio-ab@nec.com>
Content-Type: text/plain; charset="iso-2022-jp"

Kernel commit acc53a0b4c156 ("mm: rename page->index to
page->__folio_index"), which is contained in Linux 6.16-rc1 and later
kernels, renamed the member.  Without the patch, the "kmem -p" option
fails with the following error:

  kmem: invalid structure member offset: page_index
        FILE: memory.c  LINE: 6016  FUNCTION: dump_mem_map_SPARSEMEM()

Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
---
 memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/memory.c b/memory.c
index 0d8d89862383..5cb8b58e2181 100644
--- a/memory.c
+++ b/memory.c
@@ -531,6 +531,8 @@ vm_init(void)
                ASSIGN_OFFSET(page_mapping) = MEMBER_OFFSET("page", "_mapcount") +
                        STRUCT_SIZE("atomic_t") + sizeof(ulong);
         MEMBER_OFFSET_INIT(page_index, "page", "index");
+       if (INVALID_MEMBER(page_index))         /* 6.16 and later */
+               MEMBER_OFFSET_INIT(page_index, "page", "__folio_index");

This looks good to me, so: Ack.

Thanks
Lianbo
 
        if (INVALID_MEMBER(page_index))
                ANON_MEMBER_OFFSET_INIT(page_index, "page", "index");
         MEMBER_OFFSET_INIT(page_buffers, "page", "buffers");
--
2.31.1