On Fri, Feb 21, 2025 at 5:51 PM Mateusz Guzik <mjgu...@gmail.com> wrote: > > On Fri, Feb 21, 2025 at 5:30 PM Keith Busch <kbu...@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>