Re: [PATCH slab/for-next-fixes v3 3/4] lib/alloc_tag: introduce mem_alloc_profiling_permanently_disabled()
From: Suren Baghdasaryan
Date: Tue Jul 14 2026 - 10:41:36 EST
On Mon, Jul 13, 2026 at 9:28 AM Harry Yoo <harry@xxxxxxxxxx> wrote:
>
>
>
> On 7/14/26 1:15 AM, Vlastimil Babka (SUSE) wrote:
> > On 7/13/26 17:43, Suren Baghdasaryan wrote:
> >> On Mon, Jul 13, 2026 at 7:29 AM Harry Yoo (Oracle) <harry@xxxxxxxxxx> wrote:
> >>>
> >>> mem_alloc_profiling_enabled() tells whether memalloc profiling is
> >>> currently enabled. However, even when this function returns false,
> >>> it can be enabled later.
> >>>
> >>> However, this is not enough. Some optimizations can be applied only when
> >>> memalloc profiling is permanently disabled. For example, to skip the
> >>> creation of KMALLOC_NO_OBJ_EXT caches at boot time, mem_profiling must
> >>> be set to "never", "0" w/ debugging on, or have been shutdown so that
> >>> it can no longer be enabled.
> >>>
> >>> Introduce mem_alloc_profiling_permanently_disabled() for this purpose.
> >>
> >> nit: I would call it mem_alloc_profiling_supported() but this name would do.
> >
> > I wouldn't like that name, because _supported to me sounds like those
> > CONFIG_ARCH_SUPPORTS... things and not something that was just disabled.
>
> Agreed!
>
> Actually, last year I wasn't sure what "_support" in
> mem_profiling_support means and had to look at the code while fixing a
> bug [1].
>
> This year I forgot what it meant and had to look at the code again :)
>
> > I suggested mem_alloc_profiling_unavailable(), but it's not ideal either,
>
> Hehe, in terms of 'the meaning is obvious without reading the code',
> it's not very straightforward...
>
> > naming is hard.
>
> Agreed!
I'll let you pick one :)
>
> [1]
> https://lore.kernel.org/linux-mm/20250624072513.84219-1-harry.yoo@xxxxxxxxxx
>
> --
> Cheers,
> Harry / Hyeonggon
>