Questions about memcg_slabinfo.py drgn script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I was looking at the memcg_slabinfo.py drgn script that offers a
replacement to the deprecated memory.kmem.slabinfo. I had some
questions about how it collects the memcg slab stats:

1. Why does the script loop through all struct pages on the system?
Wouldn't it be more efficient to loop for every kmem_cache, for every
online kmem_cache_node, then loop through slabs_free, slabs_full, and
slabs_partial lists?

This seems more consistent with how /proc/slabinfo works, and more
efficient. I tested this on SLAB using a crash script as I am unable
to run drgn on my current setup. I am not sure how correct this would
be for SLUB though.

2. Before looping through pages, why does the script collect all
objcgs belonging to the desired memcg in a set, and then test every
objcg in a slab page to see whether it belongs to that memcg. Wouldn't
it be easier to just check objcg->memcg? AFAICT this gets updated as
well when the objcg is reparented.

Sorry for my ignorance if any of the assumptions I made are incorrect.
I just wanted to get more understanding of the implementation
decisions taken while writing the script.

Thanks.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux