[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 5 May 2021 15:19:39 -0700
From: Roman Gushchin <guro@...com>
To: Vlastimil Babka <vbabka@...e.cz>
CC: Waiman Long <longman@...hat.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Shakeel Butt <shakeelb@...gle.com>,
<linux-kernel@...r.kernel.org>, <cgroups@...r.kernel.org>,
<linux-mm@...ck.org>
Subject: Re: [PATCH v3 2/2] mm: memcg/slab: Create a new set of
kmalloc-cg-<n> caches
On Wed, May 05, 2021 at 11:29:54PM +0200, Vlastimil Babka wrote:
> On 5/5/21 8:32 PM, Roman Gushchin wrote:
> > On Wed, May 05, 2021 at 08:02:06PM +0200, Vlastimil Babka wrote:
> >> On 5/5/21 7:30 PM, Roman Gushchin wrote:
> >> > On Wed, May 05, 2021 at 11:46:13AM -0400, Waiman Long wrote:
> >> >>
> >> >> With this change, all the objcg pointer array objects will come from
> >> >> KMALLOC_NORMAL caches which won't have their objcg pointer arrays. So
> >> >> both the recursive kfree() problem and non-freeable slab problem are
> >> >> gone. Since both the KMALLOC_NORMAL and KMALLOC_CGROUP caches no longer
> >> >> have mixed accounted and unaccounted objects, this will slightly reduce
> >> >> the number of objcg pointer arrays that need to be allocated and save
> >> >> a bit of memory.
> >> >
> >> > Unfortunately the positive effect of this change will be likely
> >> > reversed by a lower utilization due to a larger number of caches.
> >> >
> >> > Btw, I wonder if we also need a change in the slab caches merging procedure?
> >> > KMALLOC_NORMAL caches should not be merged with caches which can potentially
> >> > include accounted objects.
> >>
> >> Good point. But looks like kmalloc* caches are extempt from all merging in
> >> create_boot_cache() via
> >>
> >> s->refcount = -1; /* Exempt from merging for now */
> >
> > Wait, s->refcount is adjusted to 1 in create_kmalloc_cache() after calling
> > into create_boot_cache?
>
> Hmm I missed that
>
> Now I wonder why all kmalloc caches on my system have 0 aliases :)
> cat /sys/kernel/slab/kmalloc-*/aliases
Yeah, I noticed it too, it's a good question. And I remember a case from
the past when it wasn't true (kmalloc-32 was shared with something else).
Powered by blists - more mailing lists