Over the course of a long job with lots of forks like build.sh, small but frequent contention on fstrans_lock can start to add up. This cures it by maintaining the global list of fstrans_lwp_info in a pool cache constructor and destructor, much the same pattern as is done for struct file and struct vm_amap.
fstrans_mount_lock is taken in the same path but less work is done with that lock held, so it doesn't really show up in the profile for me. http://www.netbsd.org/~ad/2020/fstrans_lock.diff Any comments? Thanks, Andrew