[PATCH v2 6/7] mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()
Mateusz Guzik
mjguzik at gmail.com
Fri Feb 21 08:52:38 PST 2025
On Fri, Feb 21, 2025 at 5:51 PM Mateusz Guzik <mjguzik at gmail.com> wrote:
>
> On Fri, Feb 21, 2025 at 5:30 PM Keith Busch <kbusch at kernel.org> wrote:
> > This patch appears to be triggering a new warning in certain conditions
> > when tearing down an nvme namespace's block device. Stack trace is at
> > the end.
> >
> > The warning indicates that this shouldn't be called from a
> > WQ_MEM_RECLAIM workqueue. This workqueue is responsible for bringing up
> > and tearing down block devices, so this is a memory reclaim use AIUI.
> > I'm a bit confused why we can't tear down a disk from within a memory
> > reclaim workqueue. Is the recommended solution to simply remove the WQ
> > flag when creating the workqueue?
> >
>
> This ends up calling into bioset_exit -> bio_put_slab -> kmem_cache_destroy
>
> Sizes of the bio- slabs are off the beaten path, so it may be they
> make sense to exist.
>
> With the assumption that caches should be there, this can instead
> invoke kmem_cache_destroy from a queue where it is safe to do it. This
> is not supposed to be a frequent operation.
Erm, I mean defer the operation to a queue which can safely do it.
--
Mateusz Guzik <mjguzik gmail.com>
More information about the Linux-nvme
mailing list