Date: Fri, 11 Feb 2011 10:46:15 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r218550 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201102111046.p1BAkF5w056852@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Feb 11 10:46:15 2011 New Revision: 218550 URL: http://svn.freebsd.org/changeset/base/218550 Log: For UIO_NOCOPY case of reading request on zfs vnode, which has vm object attached, activate the page after the successful read, and free the page if read was unsuccessfull. Freshly allocated page is not on any queue yet, and not activating (or deactivating) the page leaves it on no queue, excluding the page from pagedaemon scans and making the memory disappeared until the vnode reclaimed. Reviewed by: avg MFC after: 1 week 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 Fri Feb 11 10:06:49 2011 (r218549) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 11 10:46:15 2011 (r218550) @@ -527,9 +527,15 @@ again: zfs_unmap_page(sf); } VM_OBJECT_LOCK(obj); - if (error == 0) - m->valid = VM_PAGE_BITS_ALL; vm_page_io_finish(m); + vm_page_lock(m); + if (error == 0) { + m->valid = VM_PAGE_BITS_ALL; + vm_page_activate(m); + } else + vm_page_free(m); + vm_page_unlock(m); + if (error == 0) { uio->uio_resid -= bytes; uio->uio_offset += bytes;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102111046.p1BAkF5w056852>