From owner-svn-src-all@FreeBSD.ORG Mon Apr 8 20:02:28 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 C2156A7E; Mon, 8 Apr 2013 20:02:28 +0000 (UTC) (envelope-from attilio@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 9B69F820; Mon, 8 Apr 2013 20:02:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r38K2S9D003618; Mon, 8 Apr 2013 20:02:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r38K2SSE003616; Mon, 8 Apr 2013 20:02:28 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201304082002.r38K2SSE003616@svn.freebsd.org> From: Attilio Rao Date: Mon, 8 Apr 2013 20:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249278 - head/sys/vm 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, 08 Apr 2013 20:02:28 -0000 Author: attilio Date: Mon Apr 8 20:02:27 2013 New Revision: 249278 URL: http://svnweb.freebsd.org/changeset/base/249278 Log: The per-page act_count can be made very-easily protected by the per-page lock rather than vm_object lock, without any further overhead. Make the formal switch. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by: pho Modified: head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Apr 8 19:58:32 2013 (r249277) +++ head/sys/vm/vm_page.h Mon Apr 8 20:02:27 2013 (r249278) @@ -143,7 +143,7 @@ struct vm_page { uint8_t aflags; /* access is atomic */ uint8_t oflags; /* page VPO_* flags (O) */ uint16_t flags; /* page PG_* flags (P) */ - u_char act_count; /* page usage count (O) */ + u_char act_count; /* page usage count (P) */ u_char busy; /* page busy count (O) */ /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Apr 8 19:58:32 2013 (r249277) +++ head/sys/vm/vm_pageout.c Mon Apr 8 20:02:27 2013 (r249278) @@ -1015,9 +1015,9 @@ vm_pageout_scan(int pass) } else if ((m->aflags & PGA_REFERENCED) == 0 && (actcount = pmap_ts_referenced(m)) != 0) { vm_page_activate(m); - vm_page_unlock(m); - m->act_count += actcount + ACT_ADVANCE; VM_OBJECT_WUNLOCK(object); + m->act_count += actcount + ACT_ADVANCE; + vm_page_unlock(m); goto relock_queues; } @@ -1031,9 +1031,9 @@ vm_pageout_scan(int pass) vm_page_aflag_clear(m, PGA_REFERENCED); actcount = pmap_ts_referenced(m); vm_page_activate(m); - vm_page_unlock(m); - m->act_count += actcount + ACT_ADVANCE + 1; VM_OBJECT_WUNLOCK(object); + m->act_count += actcount + ACT_ADVANCE + 1; + vm_page_unlock(m); goto relock_queues; }