HomeFreeBSD

vm: Add a mode to vm_object_page_remove() which skips invalid pages

Description

vm: Add a mode to vm_object_page_remove() which skips invalid pages

This will be used to break a deadlock in ZFS between the per-mountpoint
teardown lock and page busy locks. In particular, when purging data
from the page cache during dataset rollback, we want to avoid blocking
on the busy state of invalid pages since the busying thread may be
blocked on the teardown lock in zfs_getpages().

Add a helper, vn_pages_remove_valid(), for use by filesystems. Bump
__FreeBSD_version so that the OpenZFS port can make use of the new
helper.

PR: 258208
Reviewed by: avg, kib, sef
Tested by: pho (part of a larger patch)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32931

Details

Provenance
markjAuthored on Nov 15 2021, 4:44 PM
Reviewer
avg
Differential Revision
D32931: zfs: Fix a deadlock between page busy and the teardown lock
Parents
rGa2665158d03e: vm_page: Remove vm_page_sbusy() and vm_page_xbusy()
Branches
Unknown
Tags
Unknown