summaryrefslogtreecommitdiff
path: root/tools/cgroup/memcg_slabinfo.py
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-03-26 20:10:32 +0300
committerAndrew Morton <akpm@linux-foundation.org>2024-04-26 06:56:15 +0300
commitdee3d0bef2b00772be430425832ead6aa9d707f9 (patch)
tree16fd8ec09f41bea6e02d6e441843513d78a9a35c /tools/cgroup/memcg_slabinfo.py
parent4dc7d37370951fe86216f03a4e0a6909f9b90a8c (diff)
downloadlinux-dee3d0bef2b00772be430425832ead6aa9d707f9.tar.xz
proc: rewrite stable_page_flags()
Reduce the usage of PageFlag tests and reduce the number of compound_head() calls. For multi-page folios, we'll now show all pages as having the flags that apply to them, e.g. if it's dirty, all pages will have the dirty flag set instead of just the head page. The mapped flag is still per page, as is the hwpoison flag. [willy@infradead.org: fix up some bits vs masks] Link: https://lkml.kernel.org/r/20240403173112.1450721-1-willy@infradead.org [willy@infradead.org: fix warnings] Link: https://lkml.kernel.org/r/ZhBPtCYfSuFuUMEz@casper.infradead.org Link: https://lkml.kernel.org/r/20240326171045.410737-11-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Svetly Todorov <svetly.todorov@memverge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/cgroup/memcg_slabinfo.py')
-rw-r--r--tools/cgroup/memcg_slabinfo.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/cgroup/memcg_slabinfo.py b/tools/cgroup/memcg_slabinfo.py
index 1d3a90d93fe2..270c28a0d098 100644
--- a/tools/cgroup/memcg_slabinfo.py
+++ b/tools/cgroup/memcg_slabinfo.py
@@ -146,12 +146,11 @@ def detect_kernel_config():
def for_each_slab(prog):
- PGSlab = 1 << prog.constant('PG_slab')
- PGHead = 1 << prog.constant('PG_head')
+ PGSlab = ~prog.constant('PG_slab')
for page in for_each_page(prog):
try:
- if page.flags.value_() & PGSlab:
+ if page.page_type.value_() == PGSlab:
yield cast('struct slab *', page)
except FaultError:
pass