As of r234483, vnode deactivation causes only non-VPO_NOSYNC pages to be
laundered. This behaviour has two problems:
- Dirty VPO_NOSYNC pages must be laundered before the vnode can be reclaimed, and this work may be unfairly deferred to the vnlru process or another application when the system is under vnode pressure.
- Deactivation of a vnode with MAP_NOSYNC mappings requires a scan of the corresponding VM object's memq for non-VPO_NOSYNC dirty pages; if the laundry thread needs to launder pages from an unreferenced vnode, it will reactivate and deactivate the vnode with each laundering, resulting in a potentially large number of expensive scans.
Therefore, ensure that all dirty pages are laundered upon deactivation,
i.e., when all maps of the vnode are removed and all references are
released.