From: Muchun Song <muchun.song@linux.dev>
To: Aveline Noir <jm5905938@gmail.com>
Cc: Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
Usama Arif <usama.arif@linux.dev>,
Karl Mehltretter <kmehltretter@gmail.com>,
Ackerley Tng <ackerleytng@google.com>,
Zhao Li <enderaoelyther@gmail.com>,
Jinmeng Zhou <zhoujinmeng@bytedance.com>,
linux-mm@kvack.org, "Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>, Michal Hocko <mhocko@suse.com>,
linux-kernel@vger.kernel.org, Omar Sandoval <osandov@osandov.com>
Subject: Re: [PATCH] tools/mm: add a drgn script to show HugeTLB reservations
Date: Fri, 27 Nov 2026 19:30:04 +0800 [thread overview]
Message-ID: <FDAF27F6-A5D1-4911-BB86-6645272E2BD3@linux.dev> (raw)
In-Reply-To: <20261126-hugetlb-resv-drgn-v1-1-345a6ee7c08c@gmail.com>
> On Nov 26, 2026, at 19:21, Aveline Noir <jm5905938@gmail.com> wrote:
>
> Add a drgn script, show_hugetlb_resv.py, to show where HugeTLB
> reservations are held in a live kernel or vmcore.
>
> HugePages_Rsvd in /proc/meminfo only reports the global reservation
> count for the default huge page size. It cannot show which files,
> private mappings or hugetlbfs mounts hold those reservations, or whether
> a subpool is below its minimum.
>
> The script walks those objects per huge page size, compares their
> reservations with resv_huge_pages, and checks subpool minima separately.
> It reads internal hugetlb and hugetlbfs structures, so keeping it in
> tools/mm/ lets it be updated alongside them.
>
> Usage:
>
> drgn -c vmcore -s vmlinux tools/mm/show_hugetlb_resv.py [--json]
> drgn -k tools/mm/show_hugetlb_resv.py [--json]
>
> Output from a vmcore taken before commit e4949a80f3b0 ("mm/hugetlb: fix
> subpool minimum reservation rollback"). All three reserved pages are
> attributed, but the mount is one page below its four-page minimum:
>
> source=dump status=mismatch (counts in huge pages)
>
> 2048 KiB: nr_huge_pages=4 free_huge_pages=4 resv_huge_pages=3
> inode_resv=3 private_resv=0 mounted_resv=0
> attributed=3 unattributed=+0 resv_floor=4 floor_shortfall=1
> sb=0xff11000004000000 path='/huge' min_hpages=4 rsv_hpages=0
> min_shortfall=1 used_hpages=3
> ino=191 name='a' resv_map_pages=3 instantiated=0 outstanding=3
>
> With the fix applied, the same test leaves rsv_hpages=1 and no
> min_shortfall.
>
> Signed-off-by: Aveline Noir <jm5905938@gmail.com>
> ---
> I wasn't sure where a script like this belongs, so I followed
> tools/mm/show_page_info.py for the placement and MAINTAINERS entry.
> Any feedback is welcome :)
The Dragon project itself probably belongs to this type of script? See
here:
https://github.com/osandov/drgn/tree/main/scripts
Thanks,
Muchun
prev parent reply other threads:[~2026-11-27 11:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 11:21 [PATCH] tools/mm: add a drgn script to show HugeTLB reservations Aveline Noir
2026-11-27 11:30 ` Muchun Song [this message]
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=FDAF27F6-A5D1-4911-BB86-6645272E2BD3@linux.dev \
--to=muchun.song@linux.dev \
--cc=ackerleytng@google.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=enderaoelyther@gmail.com \
--cc=jm5905938@gmail.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kmehltretter@gmail.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=osandov@osandov.com \
--cc=rppt@kernel.org \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=zhoujinmeng@bytedance.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