Skip to content

Commit 7f770e9

Browse files
Matthew Wilcox (Oracle)tehcaster
authored andcommitted
memcg_slabinfo: Fix use of PG_slab
Check PGTY_slab instead of PG_slab. Fixes: 4ffca5a (mm: support only one page_type per page) Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Tested-by: Roman Gushchin <roman.gushchin@linux.dev> Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev> Reviewed-by: Harry Yoo <harry.yoo@oracle.com> Link: https://patch.msgid.link/20250611155916.2579160-11-willy@infradead.org Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
1 parent 97189f8 commit 7f770e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/cgroup/memcg_slabinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ def detect_kernel_config():
146146

147147

148148
def for_each_slab(prog):
149-
PGSlab = ~prog.constant('PG_slab')
149+
slabtype = prog.constant('PGTY_slab')
150150

151151
for page in for_each_page(prog):
152152
try:
153-
if page.page_type.value_() == PGSlab:
153+
if (page.page_type.value_() >> 24) == slabtype:
154154
yield cast('struct slab *', page)
155155
except FaultError:
156156
pass

0 commit comments

Comments
 (0)