Re: [PATCH v2 12/13] mm/slab: add cache_ and slab_needs_objcg() helpers

"Vlastimil Babka (SUSE)" <[email protected]> Fri, 24 Jul 2026 18:31:51 +0200
Newsgroups org.kernel.vger.cgroups,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On 7/24/26 11:41, Hao Li wrote:
> On Mon, Jul 20, 2026 at 04:16:26PM +0200, Vlastimil Babka (SUSE) wrote:
>> Slabs of some caches never need the objcg part of struct slabobj_ext.
>> Introduce helpers to query this for a cache or a slab.
>> 
>> Introduce SLAB_MAY_ACCOUNT flag that is currently only internal and only
>> is_kmalloc_normal() caches don't have the flag.
> 
> it seems this could be "only type == KMALLOC_NORMAL caches don't have this
> flag".

I think not, because with SLUB_TINY, a KMALLOC_NORMAL cache can have
SLAB_RECLAIM_ACCOUNT flag and thus is not is_kmalloc_normal() and may need
objcgs?

Yep it's subtle :/