Re: slabinfo shows incorrect active_objs ???

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

 



> On Feb 22, 2022, at 4:10 AM, Vasily Averin <vvs@xxxxxxxxxxxxx> wrote:
> 
> On 22.02.2022 13:23, Hyeonggon Yoo wrote:
>>> On Tue, Feb 22, 2022 at 12:22:02PM +0300, Vasily Averin wrote:
>>> Dear all,
>>> 
>>> I've found that /proc/slabinfo shows inadequate numbers of in-use slab objects.
>>> it assumes that all objects stored in cpu caches are always 100% in use.
> 
>>> Is it a bug or perhaps a well-known feature that I missed?
>> This is not a bug..
> 
> Thank you for explanation,
> I think it would be useful to document this somewhere. (Documnetation? man slabinfo ?)

Man page is the best place, IMO.

> Also I would like to know is it some (fast) way to get real numbers in userspace ?
> crash is too fat for this task.
> Do you know perhaps some other userspace utility or may be systemtap/drgn script?

You can hack something based on memcg_slabinfo.py for this purpose. It already contains the code to iterate over all slab pages, you just need to gather necessary stats.
Of course the data will be racy, but should be good enough for practical purposes.
I used something like this when was looking for the real slab utilization numbers when started reworking the slab memory accounting.

> I'm preparing new set of memcg accounting patches, with reparired tools/cgroup/memcg_slapinfo.py
> I can get numbers of accounted resources, but I need to understand how may resources was NOT
> accounted to memcg but allocated on host. I expected get these numbers from host's slabinfo but
> it does not show correct numbers.

I’m really curious what these patches are. Are you looking to enable accounting for more slab caches?

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