kernel - Optimize vfs_msync() when MNTK_THR_SYNC is used
* vfs_msync() will now use vsyncscan() when MNTK_THR_SYNC is set.
Lazy synchronization scans will still properly ignore MADV_NOSYNC
areas, but will not be able to optimize away the scan overhead for
those vnodes (they remain on the syncer list).
This change allows both lazy synchronization and explicit 'sync' commands
to avoid having to scan all cached vnodes on the system, resulting in O(1)
operation in many cases where it might have taken a few seconds before
(on large systems with hundreds of thousands to millions of vnodes cached).
With this change both the vnode sync and the memory sync will be optimal.
Currently implemented for hammer1 and hammer2.
* Add VOBJDIRTY to the set of flags that will place the vnode on the
syncer list. This occurs from the vm_page_dirty() and other bits of
code only if MNTK_THR_SYNC is set.
Theoretically it should be safe for us to do this even though neither
the vm_object or the related vnode are likely locked or guarded, because
neither can go away while an associated vm_page is busied. The syncer
list code itself is protected with a token.