freebsd-dev/sys/cddl
Mark Johnston 66b415fb8f Don't block on the range lock in zfs_getpages().
After r358443 the vnode object lock no longer synchronizes concurrent
zfs_getpages() and zfs_write() (which must update vnode pages to
maintain coherence).  This created a potential deadlock between ZFS
range locks and VM page busy locks: a fault on a mapped file will cause
the fault page to be busied, after which zfs_getpages() locks a range
around the file offset in order to map adjacent, resident pages;
zfs_write() locks the range first, and then must busy vnode pages when
synchronizing.

Solve this by adding a non-blocking mode for ZFS range locks, and using
it in zfs_getpages().  If zfs_getpages() fails to acquire the range
lock, only the fault page will be populated.

Reported by:	bdrewery
Reviewed by:	avg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24839
2020-05-20 18:29:23 +00:00
..
boot/zfs loader: replace zfs_alloc/zfs_free with malloc/free 2020-02-26 18:12:12 +00:00
compat/opensolaris TODO DONE: Use sx_xholder in SPL rwlock.h 2020-03-14 00:16:15 +00:00
contrib/opensolaris Don't block on the range lock in zfs_getpages(). 2020-05-20 18:29:23 +00:00
dev Handle non-dtrace-triggered kernel breakpoint traps in mips. 2020-04-21 17:38:07 +00:00