[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200526185027.GD377498@carbon.DHCP.thefacebook.com>
Date: Tue, 26 May 2020 11:50:27 -0700
From: Roman Gushchin <guro@...com>
To: Vlastimil Babka <vbabka@...e.cz>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>, <linux-mm@...ck.org>,
<kernel-team@...com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 15/19] mm: memcg/slab: deprecate slab_root_caches
On Tue, May 26, 2020 at 12:52:24PM +0200, Vlastimil Babka wrote:
> On 4/22/20 10:47 PM, Roman Gushchin wrote:
> > Currently there are two lists of kmem_caches:
> > 1) slab_caches, which contains all kmem_caches,
> > 2) slab_root_caches, which contains only root kmem_caches.
> >
> > And there is some preprocessor magic to have a single list
> > if CONFIG_MEMCG_KMEM isn't enabled.
> >
> > It was required earlier because the number of non-root kmem_caches
> > was proportional to the number of memory cgroups and could reach
> > really big values. Now, when it cannot exceed the number of root
> > kmem_caches, there is really no reason to maintain two lists.
> >
> > We never iterate over the slab_root_caches list on any hot paths,
> > so it's perfectly fine to iterate over slab_caches and filter out
> > non-root kmem_caches.
> >
> > It allows to remove a lot of config-dependent code and two pointers
> > from the kmem_cache structure.
> >
> > Signed-off-by: Roman Gushchin <guro@...com>
>
> Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
Thanks!
>
> > @@ -1148,11 +1126,12 @@ static void cache_show(struct kmem_cache *s, struct seq_file *m)
> >
> > static int slab_show(struct seq_file *m, void *p)
> > {
> > - struct kmem_cache *s = list_entry(p, struct kmem_cache, root_caches_node);
> > + struct kmem_cache *s = list_entry(p, struct kmem_cache, list);
> >
> > - if (p == slab_root_caches.next)
> > + if (p == slab_caches.next)
> > print_slabinfo_header(m);
> > - cache_show(s, m);
> > + if (is_root_cache(s))
> > + cache_show(s, m);
>
> If there wasn't patch 17/19 we could just remove this condition and have
> /proc/slabinfo contain the -memcg variants?
Sure, it's an option too. But because it's a user facing option, I'd keep it
as it is now at least until everything will settle down a bit.
Thanks!
Powered by blists - more mailing lists