]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vm: Add a mode to vm_object_page_remove() which skips invalid pages
authorMark Johnston <markj@FreeBSD.org>
Mon, 15 Nov 2021 16:44:04 +0000 (11:44 -0500)
committerMark Johnston <markj@FreeBSD.org>
Mon, 29 Nov 2021 14:09:28 +0000 (09:09 -0500)
commitfdd27db34802decf062339411e5f84993e733be0
tree200e673d5ae9a3ae867385337490c1c4ba43330c
parent2949655427209b7d086eb35a92ea1e175d1b1a67
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)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit d28af1abf031ee87a478b37180e3f0c518caedf6)
sys/kern/vfs_vnops.c
sys/sys/vnode.h
sys/vm/vm_object.c
sys/vm/vm_object.h