[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8f89f0a-a327-441e-9bd6-17523c5fa65c@gmail.com>
Date: Wed, 29 Oct 2025 19:45:32 +0100
From: Andrey Ryabinin <ryabinin.a.a@...il.com>
To: Harry Yoo <harry.yoo@...cle.com>, akpm@...ux-foundation.org,
 vbabka@...e.cz
Cc: andreyknvl@...il.com, cl@...ux.com, dvyukov@...gle.com,
 glider@...gle.com, hannes@...xchg.org, linux-mm@...ck.org,
 mhocko@...nel.org, muchun.song@...ux.dev, rientjes@...gle.com,
 roman.gushchin@...ux.dev, shakeel.butt@...ux.dev, surenb@...gle.com,
 vincenzo.frascino@....com, yeoreum.yun@....com, tytso@....edu,
 adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH V3 6/7] mm/slab: save memory by allocating slabobj_ext
 array from leftover
On 10/27/25 1:28 PM, Harry Yoo wrote:
>  
> +#ifdef CONFIG_SLAB_OBJ_EXT
> +
> +/*
> + * Check if memory cgroup or memory allocation profiling is enabled.
> + * If enabled, SLUB tries to reduce memory overhead of accounting
> + * slab objects. If neither is enabled when this function is called,
> + * the optimization is simply skipped to avoid affecting caches that do not
> + * need slabobj_ext metadata.
> + *
> + * However, this may disable optimization when memory cgroup or memory
> + * allocation profiling is used, but slabs are created too early
> + * even before those subsystems are initialized.
> + */
> +static inline bool need_slab_obj_exts(struct kmem_cache *s)
> +{
> +	if (!mem_cgroup_disabled() && (s->flags & SLAB_ACCOUNT))
Shouldn't this be !memcg_kmem_online() check?
In case of disabled kmem accounting via 'cgroup.memory=nokmem'
> +		return true;
> +
> +	if (mem_alloc_profiling_enabled())
> +		return true;
> +
> +	return false;
> +}
> +
Powered by blists - more mailing lists
 
