Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

memcg_slabinfo: Fix use of PG_slab

Check PGTY_slab instead of PG_slab.

Fixes: 4ffca5a96678 (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>

authored by

Matthew Wilcox (Oracle) and committed by
Vlastimil Babka
7f770e94 97189f84

+2 -2
+2 -2
tools/cgroup/memcg_slabinfo.py
··· 146 146 147 147 148 148 def for_each_slab(prog): 149 - PGSlab = ~prog.constant('PG_slab') 149 + slabtype = prog.constant('PGTY_slab') 150 150 151 151 for page in for_each_page(prog): 152 152 try: 153 - if page.page_type.value_() == PGSlab: 153 + if (page.page_type.value_() >> 24) == slabtype: 154 154 yield cast('struct slab *', page) 155 155 except FaultError: 156 156 pass