* + tools-cgroup-slabinfopy-updated-to-work-on-current-kernel.patch added to -mm tree
@ 2021-04-22 23:09 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-04-22 23:09 UTC (permalink / raw)
To: guro, mhocko, mm-commits, vvs
The patch titled
Subject: tools/cgroup/slabinfo.py: updated to work on current kernel
has been added to the -mm tree. Its filename is
tools-cgroup-slabinfopy-updated-to-work-on-current-kernel.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/tools-cgroup-slabinfopy-updated-to-work-on-current-kernel.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/tools-cgroup-slabinfopy-updated-to-work-on-current-kernel.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Vasily Averin <vvs@virtuozzo.com>
Subject: tools/cgroup/slabinfo.py: updated to work on current kernel
slabinfo.py script does not work with actual kernel version.
First, it was unable to recognise SLUB susbsytem,
when I specified it manually, it was failed again with
AttributeError: 'struct page' has no member 'obj_cgroups'
... and then again with
File "tools/cgroup/memcg_slabinfo.py", line 221, in main
memcg.kmem_caches.address_of_(),
AttributeError: 'struct mem_cgroup' has no member 'kmem_caches'
Link: https://lkml.kernel.org/r/cec1a75e-43b4-3d64-2084-d9f98fda037f@virtuozzo.com
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/cgroup/memcg_slabinfo.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/tools/cgroup/memcg_slabinfo.py~tools-cgroup-slabinfopy-updated-to-work-on-current-kernel
+++ a/tools/cgroup/memcg_slabinfo.py
@@ -128,9 +128,9 @@ def detect_kernel_config():
cfg['nr_nodes'] = prog['nr_online_nodes'].value_()
- if prog.type('struct kmem_cache').members[1][1] == 'flags':
+ if prog.type('struct kmem_cache').members[1].name == 'flags':
cfg['allocator'] = 'SLUB'
- elif prog.type('struct kmem_cache').members[1][1] == 'batchcount':
+ elif prog.type('struct kmem_cache').members[1].name == 'batchcount':
cfg['allocator'] = 'SLAB'
else:
err('Can\'t determine the slab allocator')
@@ -193,7 +193,7 @@ def main():
# look over all slab pages, belonging to non-root memcgs
# and look for objects belonging to the given memory cgroup
for page in for_each_slab_page(prog):
- objcg_vec_raw = page.obj_cgroups.value_()
+ objcg_vec_raw = page.memcg_data.value_()
if objcg_vec_raw == 0:
continue
cache = page.slab_cache
@@ -202,7 +202,7 @@ def main():
addr = cache.value_()
caches[addr] = cache
# clear the lowest bit to get the true obj_cgroups
- objcg_vec = Object(prog, page.obj_cgroups.type_,
+ objcg_vec = Object(prog, 'struct obj_cgroup **',
value=objcg_vec_raw & ~1)
if addr not in stats:
_
Patches currently in -mm which might be from vvs@virtuozzo.com are
tools-cgroup-slabinfopy-updated-to-work-on-current-kernel.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-22 23:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 23:09 + tools-cgroup-slabinfopy-updated-to-work-on-current-kernel.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.