From owner-svn-src-all@FreeBSD.ORG Mon May 6 21:04:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5951BE0; Mon, 6 May 2013 21:04:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A84956A2; Mon, 6 May 2013 21:04:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46L4gsY065256; Mon, 6 May 2013 21:04:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46L4gS1065255; Mon, 6 May 2013 21:04:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305062104.r46L4gS1065255@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 May 2013 21:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250310 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 21:04:42 -0000 Author: kib Date: Mon May 6 21:04:42 2013 New Revision: 250310 URL: http://svnweb.freebsd.org/changeset/base/250310 Log: Avoid deactivating the page if it is already on a queue, only requeue the page. This both reduces the number of queues locking and avoids moving the active page to inactive list just because the page was read or written. Based on the suggestion by: alc Reviewed by: alc Tested by: pho Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Mon May 6 20:58:02 2013 (r250309) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Mon May 6 21:04:42 2013 (r250310) @@ -493,10 +493,12 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p VM_OBJECT_WLOCK(tobj); vm_page_lock(m); vm_page_unhold(m); - vm_page_deactivate(m); - /* Requeue to maintain LRU ordering. */ - if (m->queue != PQ_NONE) + if (m->queue == PQ_NONE) { + vm_page_deactivate(m); + } else { + /* Requeue to maintain LRU ordering. */ vm_page_requeue(m); + } vm_page_unlock(m); VM_OBJECT_WUNLOCK(tobj); @@ -609,10 +611,12 @@ tmpfs_mappedwrite(vm_object_t tobj, size vm_page_dirty(tpg); vm_page_lock(tpg); vm_page_unhold(tpg); - vm_page_deactivate(tpg); - /* Requeue to maintain LRU ordering. */ - if (tpg->queue != PQ_NONE) + if (tpg->queue == PQ_NONE) { + vm_page_deactivate(tpg); + } else { + /* Requeue to maintain LRU ordering. */ vm_page_requeue(tpg); + } vm_page_unlock(tpg); VM_OBJECT_WUNLOCK(tobj);