Re: [PATCH v2] netfs: Fix missing alloc tagging of direct mempool allocations
From: Christoph Hellwig
Date: Mon Sep 28 2026 - 01:29:02 EST
On Thu, Sep 24, 2026 at 11:36:19AM +0200, Vlastimil Babka (SUSE) wrote:
> > Closes: https://lore.kernel.org/all/0b004319-9ef7-437c-a4dd-174d6a9a83db@xxxxxxxxxxx/
> > Tested-by: Erhard Furtner <erhard_f@xxxxxxxxxxx>
> > Suggested-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Hao Ge <hao.ge@xxxxxxxxx>
>
> Acked-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
>
> Seems ok enough as a hotfix. The naming perhaps isn't ideal, we have
> mempool_alloc_preallocated() already for the opposite case. Maybe
> mempool_alloc_no_preallocated() to complement it? Rather long though.
None of this is ok. Directly alling into mempool->alloc, using a
wrapper and not is stupid and broken. Just switch the code to use
mempool_alloc undconditionally or to use a manually
kmalloc/kmem_cache_allow if the subsystem has a really good reason
to not use a mempool for non-writeback requests, but it'd better be
a really good and well-documented reason.