It is easy to forget to configure DEBUG_VFS_LOCKS, and when one does, no
vnode lock assertions are checked when INVARIANTS is configured, so bugs
can arise. This has happened to me more than once, so let's make the
assertions useful in plain INVARIANTS kernels.
To assess the overhead, I ran ten buildkernels with and without the
patch. The results are here:
https://people.freebsd.org/~markj/debug_vfs_locks_overhead.txt
There is certainly a small increase in build times, but I think it is
small enough that the change is reasonable. In particular, with a
NODEBUG kernel the system time is reduced by almost 50%.