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) <[email protected]> Tested-by: Roman Gushchin <[email protected]> Reviewed-by: Roman Gushchin <[email protected]> Reviewed-by: Harry Yoo <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 97189f8 commit 7f770e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)