Re: [PATCH v2] tools/mm: Add script to display page state for a given PID and VADDR

Andrew Morton <[email protected]> Mon, 21 Apr 2025 12:13:04 -0700
Newsgroups org.kernel.vger.linux-debuggers,org.kernel.vger.linux-kernel,org.kernel.vger.linux-toolchains,org.kvack.linux-mm
Message-ID <[email protected]>
On Mon, 21 Apr 2025 16:07:48 +0800 Ye Liu <[email protected]> wrote:

> Output example:

The spacing around the colons is inconsistent and a bit odd, IMO.

> sudo ./show_page_info.py 1 0x7f2c7de4c000
> PID : 1 Comm : systemd mm : 0xffff888116b6d440

PID: 1 Comm: systemd mm: 0xffff888116b6d440

would be more conventional. Or

PID:1 Comm:systemd mm:0xffff888116b6d440

> User Virtual Address : 0x7f2c7de4c000
> Page Address    : 0xffffea000b3a4000
> raw: 0017ffffc000416c ffffea00045d1b08 ffffea000456d408 ffff888104521970
> raw: 0000000000000000 ffff8881083fdb60 0000006900000018 ffff888107a41000
> Page Flags      : PG_referenced|PG_uptodate|PG_lru|PG_head|PG_active|
>                   PG_private|PG_reported
> Page Size       : 16384
> Page PFN        : 0x2ce900
> Page Physical   : 0x2ce900000
> Page Virtual    : 0xffff8882ce900000
> Page Refcount   : 105
> Page Mapcount   : 24
> Page Index      : 0x0
> Page Memcg Data : 0xffff888107a41000
> Memcg Name      : init.scope
> Memcg Path      : /sys/fs/cgroup/memory/init.scope
> Page Mapping    : 0xffff888104521970
> Page Anon/File  : File
> Page VMA        : 0xffff888109e135e8
> VMA Start       : 0x7f2c7de4c000
> VMA End         : 0x7f2c7de58000
> This page is part of a compound page.
> This page is the head page of a compound page.
> Head Page       : 0xffffea000b3a4000
> Compound Order  : 2
> Number of Pages : 4

I think the style of /proc/meminfo (for example) would be more expected.