Re: [PATCH v3 09/13] mm/slab: introduce slab_obj_ext_has_codetag()

Harry Yoo <[email protected]> Tue, 4 Aug 2026 06:18:44 +0000
Newsgroups gmane.linux.kernel.cgroups,gmane.linux.kernel.mm,gmane.linux.kernel
Message-ID <anGDu9pzT3Forx7_@dev>
On Mon, Jul 27, 2026 at 02:54:03PM +0200, Vlastimil Babka (SUSE) wrote:
> mem_alloc_profiling_enabled() allows evaluating (with a static key) if
> memory profiling is currently enabled. mem_profiling_support is a
> variable where false means it's not possible to enable it anymore,
> because the system was booted with "never" or it was later shut down.
> This is possible to query by mem_alloc_profiling_permanently_disabled().
> 
> To make slabobj_ext array size handling dynamic, we need a snapshot of
> mem_alloc_profiling_permanently_disabled() early in boot, so that's not
> affected by a later shutdown. We also need it to be static key based for
> performance. Neither mem_alloc_profiling_enabled() nor
> mem_alloc_profiling_permanently_disabled() satisfy this.
> 
> Therefore introduce slab_obj_ext_has_codetag() with an underlying static
> key for that use case. Its state is made to reflect the result of
> mem_alloc_profiling_permanently_disabled() during kmem_cache_init(),
> which does happen after setup_early_mem_profiling().
> 
> Reviewed-by: Suren Baghdasaryan <[email protected]>
> Signed-off-by: Vlastimil Babka (SUSE) <[email protected]>
> ---

Reviewed-by: Harry Yoo <[email protected]>

-- 
Cheers,
Harry / Hyeonggon