On Fri, Jul 17, 2026 at 09:02:36AM -0400, Mark Johnston wrote: M> On Fri, Jul 17, 2026 at 01:40:13AM +0000, Gleb Smirnoff wrote: M> > The branch main has been updated by glebius: M> > M> > URL: https://cgit.FreeBSD.org/src/commit/?id=56ac3351c61f285ee5b8c9bd4411eeaeb20efe26 M> > M> > commit 56ac3351c61f285ee5b8c9bd4411eeaeb20efe26 M> > Author: Gleb Smirnoff <[email protected]> M> > AuthorDate: 2026-07-17 01:37:03 +0000 M> > Commit: Gleb Smirnoff <[email protected]> M> > CommitDate: 2026-07-17 01:37:03 +0000 M> > M> > witness: fix operation without WITNESS_SKIPSPIN M> > M> > Since malloc(9) even with M_NOWAIT is forbidden when we hold a spinlock, M> > we can't print detailed lock tree as the operation tries to allocate M> > memory. M> M> I think malloc() actually can't be used at all here. It's possible to M> recurse into the vmem boundary tag allocator; syzkaller triggered the M> panic below once for me. M> M> Can we preallocate a single tracker at boot time, protected by w_mtx?
I'd leave this to Jonathan's decision. My personal take is that WITNESS is a helper for developers, not a production feature. If the code gives us a hint on lock order in 99% cases and recurses deep in malloc() in 1% times it is good enough. Of course if recursion can be avioded easily, this should be done. -- Gleb Smirnoff
