Re: [PATCH] tools/mm: add a drgn script to show HugeTLB reservations
From: Aveline Noir
Date: Mon Nov 30 2026 - 20:17:27 EST
Hi Omar,
> To be fair, just about everything in drgn is closely tied to subsystem
> internals, so I don't think that has much weight on where a script
> should go, and that wasn't my point in
> https://lore.kernel.org/r/aACaf4_molKromnT@telecaster.
I agree with you on this.
> 1. How reusable is it?
> a. Very generic -> drgn helper
> b. Specific but generally useful -> drgn tool or contrib directory
> c. Very specific to a handful of developers of a specific subsystem
> -> kernel tree
Yep, that's also why I submitted this to tools/mm/ in the first place.
The tool seems fairly specialized, at least in its current form.
> 2. Who will test and maintain it for kernel changes?
> a. Kernel developer -> kernel tree
> b. Author will support all kernel versions and write unit tests ->
> drgn can take it and maintain it from there
> c. Nobody -> either drgn contrib directory or kernel tree, doesn't
> really matter. The former is usually easier
Personally, I'd be happy to maintain the script for mainline and major
kernel releases. I'm also willing to write unit tests, though that
might take a back seat when things get busy on my end.
Thanks for your perspective, Omar! These guidelines look quite
reasonable to me, and I'd be interested in hearing what others
think :)
Thanks,
Aveline Noir
On Mon, 30 Nov 2026 16:40:25 -0800, Omar Sandoval <osandov@xxxxxxxxxxx> wrote:
> On Fri, Nov 27, 2026 at 08:14:19PM -0800, Aveline Noir wrote:
> > Hi Vlastimil,
> >
> > > and automatically detecting which scheme applies (not from version, but from
> > > what fields exist or not in the relevant structs, etc). Like e.g. the crash
> > > tool does.
> >
> > LGTM! I'll work on that :)
> >
> > > IMHO it's better if the support is part of drgn itself and can be adjusted
> > > with kernel changes while still supporting older kernels at the same time,
> > > [...]
> > > the user, who doesn't need to fish for the right kernel version's scripts.
> > > Which may anyway become out of sync because nobody notices, and are only
> > > fixed in a later version.
> >
> > Regarding placement, this ties into the discussion you, Omar, and Ye had
> > back in July:
> >
> > https://lore.kernel.org/all/20260715-b4-objext_split-v1-0-9a49c4ccf4c3@xxxxxxxxxx/T/
> >
> > For tools closely tied to subsystem internals and accounting logic, I
> > think there is still value in keeping them in-tree alongside the kernel
> > implementation, as it can make tracking relevant changes and maintaining
> > the tools easier.
>
> To be fair, just about everything in drgn is closely tied to subsystem
> internals, so I don't think that has much weight on where a script
> should go, and that wasn't my point in
> https://lore.kernel.org/r/aACaf4_molKromnT@telecaster.
>
> To phrase my preferred guidelines from that message differently:
>
> 1. How reusable is it?
> a. Very generic -> drgn helper
> b. Specific but generally useful -> drgn tool or contrib directory
> c. Very specific to a handful of developers of a specific subsystem
> -> kernel tree
> 2. Who will test and maintain it for kernel changes?
> a. Kernel developer -> kernel tree
> b. Author will support all kernel versions and write unit tests ->
> drgn can take it and maintain it from there
> c. Nobody -> either drgn contrib directory or kernel tree, doesn't
> really matter. The former is usually easier
>
> Thanks,
> Omar