There is an order between covered vnode lock and allproc_lock, which is established by calling mountcheckdirs() while owning the covered vnode lock. mountcheckdirs() iterates over the processes, protected by allproc_lock. I do not see how this can be changed.
On the other hand, various VM daemons also need to iterate over all processes, and they lock and unlock user maps. Since unlock of the user map may trigger processing of the deferred map entries, it causes vnode locking to occur. Or, when vmspace is freed, dropping references on the vnode-backed object also lock vnodes. We get reverted order comparing with the mount/unmount order.
For VM daemons, I do not see a need to own allproc_lock while we operate on vmspaces. If the process is held, it serves as the marker for allproc list iterator. This is the main change in the patch.
Also, several PHOLD() calls in the sys/vm were replaced by direct increment of p_lock, since I think that calling faultin() for OOM is wrong.