From: Vasily Averin <vvs@virtuozzo.com>
To: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Hyeonggon Yoo <42.hyeyoo@gmail.com>,
Christoph Lameter <cl@linux.com>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Pekka Enberg <penberg@kernel.org>, Linux MM <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
kernel@openvz.org
Subject: Re: slabinfo shows incorrect active_objs ???
Date: Fri, 25 Feb 2022 07:37:30 +0300 [thread overview]
Message-ID: <1c73adc1-f780-56ac-4c67-490670a27951@virtuozzo.com> (raw)
In-Reply-To: <4BC89091-F314-4785-BCBB-189CE42B0192@linux.dev>
On 25.02.2022 03:08, Roman Gushchin wrote:
>
>> On Feb 24, 2022, at 5:17 AM, Vasily Averin <vvs@virtuozzo.com> wrote:
>>
>> On 22.02.2022 19:32, Shakeel Butt wrote:
>>> If you are just interested in the stats, you can use SLAB for your experiments.
>>
>> Unfortunately memcg_slabino.py does not support SLAB right now.
>>
>>> On 23.02.2022 20:31, Vlastimil Babka wrote:
>>>> On 2/23/22 04:45, Hyeonggon Yoo wrote:
>>>> On Wed, Feb 23, 2022 at 01:32:36AM +0100, Vlastimil Babka wrote:
>>>>> Hm it would be easier just to disable merging when the precise counters are
>>>>> enabled. Assume it would be a config option (possibly boot-time option with
>>>>> static keys) anyway so those who don't need them can avoid the overhead.
>>>>
>>>> Is it possible to accurately account objects in SLUB? I think it's not
>>>> easy because a CPU can free objects to remote cpu's partial slabs using
>>>> cmpxchg_double()...
>>> AFAIU Roman's idea would be that each alloc/free would simply inc/dec an
>>> object counter that's disconnected from physical handling of particular sl*b
>>> implementation. It would provide exact count of objects from the perspective
>>> of slab users.
>>> I assume for reduced overhead the counters would be implemented in a percpu
>>> fashion as e.g. vmstats. Slabinfo gathering would thus have to e.g. sum up
>>> those percpu counters.
>>
>> I like this idea too and I'm going to spend some time for its implementation.
>
> Sounds good!
>
> Unfortunately it’s quite tricky: the problem is that there is potentially a large and dynamic set of cgroups and also large and dynamic set of slab caches. Given the performance considerations, it’s also unlikely to avoid using percpu variables.
> So we come to the (nr_slab_caches * nr_cgroups * nr_cpus) number of “objects”. If we create them proactively, we’re likely wasting lot of memory. Creating them on demand is tricky too (especially without losing some accounting accuracy).
I told about global (i.e. non-memcg) precise slab counters only.
I'm expect it can done under new config option and/or static key, and if present use them in /proc/slabinfo output.
At present I'm still going to extract memcg counters via your memcg_slabinfo script.
Thank you,
Vasily Averin
next prev parent reply other threads:[~2022-02-25 4:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 9:22 Vasily Averin
2022-02-22 10:23 ` Hyeonggon Yoo
2022-02-22 12:10 ` Vasily Averin
2022-02-22 16:32 ` Shakeel Butt
2022-02-22 16:47 ` Roman Gushchin
2022-02-23 1:07 ` Vasily Averin
2022-02-22 20:59 ` Roman Gushchin
2022-02-22 23:08 ` Vlastimil Babka
2022-02-23 0:07 ` Roman Gushchin
2022-02-23 0:32 ` Vlastimil Babka
2022-02-23 3:45 ` Hyeonggon Yoo
2022-02-23 17:31 ` Vlastimil Babka
2022-02-23 18:15 ` Roman Gushchin
2022-02-24 13:16 ` Vasily Averin
2022-02-25 0:08 ` Roman Gushchin
2022-02-25 4:37 ` Vasily Averin [this message]
2022-02-28 6:17 ` Vasily Averin
2022-02-28 10:22 ` Hyeonggon Yoo
2022-02-28 10:28 ` Hyeonggon Yoo
2022-02-28 10:43 ` Hyeonggon Yoo
2022-02-28 12:09 ` Hyeonggon Yoo
2022-03-03 8:39 ` Christoph Lameter
2022-03-04 16:29 ` Vlastimil Babka
2022-02-22 11:10 ` Vlastimil Babka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c73adc1-f780-56ac-4c67-490670a27951@virtuozzo.com \
--to=vvs@virtuozzo.com \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=kernel@openvz.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox