]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Launder VPO_NOSYNC pages upon vnode deactivation.
authorMark Johnston <markj@FreeBSD.org>
Sat, 26 Nov 2016 21:00:27 +0000 (21:00 +0000)
committerMark Johnston <markj@FreeBSD.org>
Sat, 26 Nov 2016 21:00:27 +0000 (21:00 +0000)
commit64910ddbff1748041769d5e1d44b4df48b45504a
tree35c28eefa95db76dc254a61f033690e228b0998c
parent1616a51df4800315dee3bf690c848e710d039516
Launder VPO_NOSYNC pages upon vnode deactivation.

As of r234483, vnode deactivation causes non-VPO_NOSYNC pages to be
laundered. This behaviour has two problems:

1. 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 an unrelated application when the system is under vnode pressure.
2. Deactivation of a vnode with dirty VPO_NOSYNC pages 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 such
   vnode, it will reactivate and deactivate the vnode with each laundering,
   potentially resulting in a 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.

Reviewed by: alc, kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8641
lib/libc/sys/mmap.2
sys/kern/vfs_subr.c