Re: [PATCH v2 12/13] mm/slab: add cache_ and slab_needs_objcg() helpers
From: Vlastimil Babka (SUSE)
Date: Fri Jul 24 2026 - 12:51:33 EST
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 :/