Date: Wed, 15 Sep 2010 10:39:22 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212652 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201009151039.o8FAdMp4030375@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Wed Sep 15 10:39:21 2010 New Revision: 212652 URL: http://svn.freebsd.org/changeset/base/212652 Log: 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 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:32:32 2010 (r212651) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:39:21 2010 (r212652) @@ -323,8 +323,17 @@ page_lookup(vnode_t *vp, int64_t start, 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_ 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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009151039.o8FAdMp4030375>