* Fixing memcg_slabinfo.py
@ 2025-06-06 17:33 Matthew Wilcox
2025-06-06 21:37 ` Roman Gushchin
0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2025-06-06 17:33 UTC (permalink / raw)
To: Roman Gushchin; +Cc: linux-mm
Looks like nobody's used memcg_slabinfo.py in the last year when I broke
it with 4ffca5a96678. It should probably be fixed, but I'm not fluent
in Python and don't use drgn myself, so have no way to verify the below
is even syntactically correct, let alone works.
diff --git a/tools/cgroup/memcg_slabinfo.py b/tools/cgroup/memcg_slabinfo.py
index 270c28a0d098..bb3de16e3510 100644
--- a/tools/cgroup/memcg_slabinfo.py
+++ b/tools/cgroup/memcg_slabinfo.py
@@ -146,11 +146,11 @@ def detect_kernel_config():
def for_each_slab(prog):
- PGSlab = ~prog.constant('PG_slab')
+ PGTYslab = prog.constant('PGTY_slab')
for page in for_each_page(prog):
try:
- if page.page_type.value_() == PGSlab:
+ if (page.page_type.value_() >> 24) == PGTYslab:
yield cast('struct slab *', page)
except FaultError:
pass
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: Fixing memcg_slabinfo.py
2025-06-06 17:33 Fixing memcg_slabinfo.py Matthew Wilcox
@ 2025-06-06 21:37 ` Roman Gushchin
0 siblings, 0 replies; 2+ messages in thread
From: Roman Gushchin @ 2025-06-06 21:37 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-mm
Matthew Wilcox <willy@infradead.org> writes:
> Looks like nobody's used memcg_slabinfo.py in the last year when I broke
> it with 4ffca5a96678. It should probably be fixed, but I'm not fluent
> in Python and don't use drgn myself, so have no way to verify the below
> is even syntactically correct, let alone works.
Hi Matthew!
The patch looks good to me (assuming a proper commit log). I gave it a
test on top of 6.14.9 (which is running my Fedora laptop currently) and
it worked fine.
Tested-by: Roman Gushchin <roman.gushchin@linux.dev>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Thanks!
>
> diff --git a/tools/cgroup/memcg_slabinfo.py b/tools/cgroup/memcg_slabinfo.py
> index 270c28a0d098..bb3de16e3510 100644
> --- a/tools/cgroup/memcg_slabinfo.py
> +++ b/tools/cgroup/memcg_slabinfo.py
> @@ -146,11 +146,11 @@ def detect_kernel_config():
>
>
> def for_each_slab(prog):
> - PGSlab = ~prog.constant('PG_slab')
> + PGTYslab = prog.constant('PGTY_slab')
>
> for page in for_each_page(prog):
> try:
> - if page.page_type.value_() == PGSlab:
> + if (page.page_type.value_() >> 24) == PGTYslab:
> yield cast('struct slab *', page)
> except FaultError:
> pass
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-06 21:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 17:33 Fixing memcg_slabinfo.py Matthew Wilcox
2025-06-06 21:37 ` Roman Gushchin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).