https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253992
System with a based-on-FreeBSD-12 kernel but with a timeout panic for the UFS root vnode lock paniced due to a ufsdirhash_build() call with M_WAITOK, UMA_ZONE_FIRSTTOUCH (the default) and a domain which was OOM. The ufsdirhash_build() code is invoked with the directory vnode exclusively locked (per ufs_lookup.c / the caller) and in all other places takes care to allocate M_NOWAIT to avoid such issues.
So it seems reasonable to make this one allocation also M_NOWAIT instead of M_WAITOK, especially given the FIRSTTOUCH default behavior where only the calling cpu's domain can satisfy the request.