From: Ye Liu <ye.liu@linux.dev>
To: Florian Weimer <fweimer@redhat.com>
Cc: akpm@linux-foundation.org, linux-debuggers@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-toolchains@vger.kernel.org, osandov@osandov.com,
paulmck@kernel.org, sweettea-kernel@dorminy.me, liuye@kylinos.cn
Subject: Re: [PATCH v3] tools/mm: Add script to display page state for a given PID and VADDR
Date: Thu, 24 Apr 2025 10:17:59 +0800 [thread overview]
Message-ID: <ba37651b-95fd-4db2-8806-58cd2a08a979@linux.dev> (raw)
In-Reply-To: <87jz7bky7i.fsf@oldenburg.str.redhat.com>
在 2025/4/23 17:45, Florian Weimer 写道:
> * Ye Liu:
>
>> From: Ye Liu <liuye@kylinos.cn>
>>
>> Introduces a new drgn script, `show_page_info.py`, which allows users
>> to analyze the state of a page given a process ID (PID) and a virtual
>> address (VADDR). This can help kernel developers or debuggers easily
>> inspect page-related information in a live kernel or vmcore.
>>
>> The script extracts information such as the page flags, mapping, and
>> other metadata relevant to diagnosing memory issues.
>>
>> Output example:
>> sudo ./show_page_info.py 1 0x7f43df5acf00
>> PID: 1 Comm: systemd mm: 0xffff8881273bbc40
>> Raw: 0017ffffc000416c ffffea00043a4508 ffffea0004381e08 ffff88810f086a70
>> Raw: 0000000000000000 ffff888120c9b0c0 0000002500000007 ffff88812642c000
>> User Virtual Address: 0x7f43df5acf00
>> Page Address: 0xffffea00049a0b00
>> Page Flags: PG_referenced|PG_uptodate|PG_lru|PG_head|PG_active|
>> PG_private|PG_reported
>> Page Size: 16384
>> Page PFN: 0x12682c
>> Page Physical: 0x12682c000
>> Page Virtual: 0xffff88812682c000
>> Page Refcount: 37
>> Page Mapcount: 7
>> Page Index: 0x0
>> Page Memcg Data: 0xffff88812642c000
>> Memcg Name: init.scope
>> Memcg Path: /sys/fs/cgroup/memory/init.scope
>> Page Mapping: 0xffff88810f086a70
>> Page Anon/File: File
>> Page VMA: 0xffff88810e4af3b8
>> VMA Start: 0x7f43df5ac000
>> VMA End: 0x7f43df5b0000
>> This page is part of a compound page.
>> This page is the head page of a compound page.
>> Head Page: 0xffffea00049a0b00
>> Compound Order: 2
>> Number of Pages: 4
> Does this show the page access flags anywhere in the output? If not,
> would it be possible to include this information?
This script is currently a basic version, and we plan to gradually add
more detailed information about pages, including the page access flags
you mentioned, as well as PGD, PUD, PMD, PTE, file/anon rmap folios,
and more. This will be refined over time.
Thanks,
Ye Liu
> Thanks,
> Florian
>
next prev parent reply other threads:[~2025-04-24 2:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 1:48 [PATCH v3] tools/mm: Add script to display page state for a given PID and VADDR Ye Liu
2025-04-23 9:45 ` Florian Weimer
2025-04-24 2:17 ` Ye Liu [this message]
2025-04-23 22:00 ` SeongJae Park
2025-04-24 1:55 ` Ye Liu
2025-04-24 2:51 ` SeongJae Park
2025-04-24 3:24 ` Ye Liu
2025-04-24 3:49 ` SeongJae Park
2025-04-24 3:27 ` Ye Liu
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=ba37651b-95fd-4db2-8806-58cd2a08a979@linux.dev \
--to=ye.liu@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=fweimer@redhat.com \
--cc=linux-debuggers@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-toolchains@vger.kernel.org \
--cc=liuye@kylinos.cn \
--cc=osandov@osandov.com \
--cc=paulmck@kernel.org \
--cc=sweettea-kernel@dorminy.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.