Re: [PATCH v2 1/1] mm/slab: mark alloc tags empty for sheafs allocated with __GFP_NO_OBJ_EXT
From: Suren Baghdasaryan
Date: Wed Feb 25 2026 - 11:39:44 EST
On Wed, Feb 25, 2026 at 8:04 AM Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote:
>
> On Tue, Feb 24, 2026 at 6:26 PM Harry Yoo <harry.yoo@xxxxxxxxxx> wrote:
> >
> > On Tue, Feb 24, 2026 at 02:11:32PM -0800, Suren Baghdasaryan wrote:
> > > alloc_empty_sheaf() allocates sheafs from SLAB_KMALLOC caches using
> >
> > nit: the plural form of sheaf is "sheaves" ;)
>
> Ack.
>
> >
> > > __GFP_NO_OBJ_EXT to avoid recursion, however it does not mark their
> > > allocation tags empty before freeing, which results in a warning when
> > > CONFIG_MEM_ALLOC_PROFILING_DEBUG is set. Fix this by marking allocation
> > > tags for such allocations as empty.
> > >
> > > Reported-by: David Wang <00107082@xxxxxxx>
> > > Closes: https://lore.kernel.org/all/20260223155128.3849-1-00107082@xxxxxxx/
> > > Analyzed-by: Harry Yoo <harry.yoo@xxxxxxxxxx>
> > > Signed-off-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> > > ---
> >
> > This resolves the issue on my machine.
> > and the fix looks good to me, so:
> >
> > Tested-by: Harry Yoo <harry.yoo@xxxxxxxxxx>
> >
> > and
> >
> > Reviewed-by: Harry Yoo <harry.yoo@xxxxxxxxxx>
> >
> > By the way, perhaps it's worth adding a comment on __GFP_NO_OBJ_EXT
> > saying "you need to call mark_objexts_empty() before freeing the
> > object".
>
> Good idea. I'll post v3 with that comment and spelling fix.
I added comments and also renamed mark_objexts_empty() into
mark_obj_codetag_empty() to better reflect the functionality since
it's now used not only for objexts.
v3 is posted here:
https://lore.kernel.org/all/20260225163407.2218712-1-surenb@xxxxxxxxxx/
> Thanks!
>
> >
> > --
> > Cheers,
> > Harry / Hyeonggon