summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2010-09-15 10:39:21 +0000
committeravg <avg@FreeBSD.org>2010-09-15 10:39:21 +0000
commitddc57216202849466782a4800562795d535bc7ae (patch)
treeb58afab2f6418c00a77f90569689a97fab6149ec /sys/cddl/contrib
parente6e37d7e7dff8b4f6d00909c7f7a7fdceb4adbe7 (diff)
downloadFreeBSD-src-ddc57216202849466782a4800562795d535bc7ae.zip
FreeBSD-src-ddc57216202849466782a4800562795d535bc7ae.tar.gz
zfs: catch up with vm_page_sleep_if_busy changes
Reviewed by: alc Approved by: pjd Tested by: tools/regression/fsx MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/contrib')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
index 4aa68a7..9956516 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
@@ -323,8 +323,17 @@ page_lookup(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes)
for (;;) {
if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL &&
vm_page_is_valid(pp, (vm_offset_t)off, nbytes)) {
- if (vm_page_sleep_if_busy(pp, FALSE, "zfsmwb"))
+ if ((pp->oflags & VPO_BUSY) != 0) {
+ /*
+ * Reference the page before unlocking and
+ * sleeping so that the page daemon is less
+ * likely to reclaim it.
+ */
+ vm_page_lock_queues();
+ vm_page_flag_set(pp, PG_REFERENCED);
+ vm_page_sleep(pp, "zfsmwb");
continue;
+ }
vm_page_busy(pp);
vm_page_undirty(pp);
} else {
@@ -451,8 +460,18 @@ mappedread(vnode_t *vp, int nbytes, uio_t *uio)
again:
if ((m = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL &&
vm_page_is_valid(m, (vm_offset_t)off, bytes)) {
- if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb"))
+ if ((m->oflags & VPO_BUSY) != 0) {
+ /*
+ * Reference the page before unlocking and
+ * sleeping so that the page daemon is less
+ * likely to reclaim it.
+ */
+ vm_page_lock_queues();
+ vm_page_flag_set(m, PG_REFERENCED);
+ vm_page_sleep(m, "zfsmrb");
goto again;
+ }
+
vm_page_busy(m);
VM_OBJECT_UNLOCK(obj);
if (dirbytes > 0) {
@@ -478,8 +497,17 @@ again:
* but it pessimize performance of sendfile/UFS, that's
* why I handle this special case in ZFS code.
*/
- if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb"))
+ if ((m->oflags & VPO_BUSY) != 0) {
+ /*
+ * Reference the page before unlocking and
+ * sleeping so that the page daemon is less
+ * likely to reclaim it.
+ */
+ vm_page_lock_queues();
+ vm_page_flag_set(m, PG_REFERENCED);
+ vm_page_sleep(m, "zfsmrb");
goto again;
+ }
vm_page_busy(m);
VM_OBJECT_UNLOCK(obj);
if (dirbytes > 0) {
OpenPOWER on IntegriCloud