]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
memcg_slabinfo: Fix use of PG_slab
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 11 Jun 2025 15:59:13 +0000 (16:59 +0100)
committerVlastimil Babka <vbabka@suse.cz>
Wed, 23 Jul 2025 09:55:22 +0000 (11:55 +0200)
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>
tools/cgroup/memcg_slabinfo.py

index 270c28a0d09801ac02a1ac6e356610c66de9b724..6bf4bde77903c3d048f1ac4ccc183969d6c73e92 100644 (file)
@@ -146,11 +146,11 @@ def detect_kernel_config():
 
 
 def for_each_slab(prog):
-    PGSlab = ~prog.constant('PG_slab')
+    slabtype = prog.constant('PGTY_slab')
 
     for page in for_each_page(prog):
         try:
-            if page.page_type.value_() == PGSlab:
+            if (page.page_type.value_() >> 24) == slabtype:
                 yield cast('struct slab *', page)
         except FaultError:
             pass