From owner-svn-src-head@FreeBSD.ORG Tue May 28 22:07:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CACC4F40; Tue, 28 May 2013 22:07:23 +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 A3AB4D88; Tue, 28 May 2013 22:07:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SM7Nek065772; Tue, 28 May 2013 22:07:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SM7Nh2065771; Tue, 28 May 2013 22:07:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305282207.r4SM7Nh2065771@svn.freebsd.org> From: Attilio Rao Date: Tue, 28 May 2013 22:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251077 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 22:07:23 -0000 Author: attilio Date: Tue May 28 22:07:23 2013 New Revision: 251077 URL: http://svnweb.freebsd.org/changeset/base/251077 Log: o Change the locking scheme for swp_bcount. It can now be accessed with a write lock on the object containing it OR with a read lock on the object containing it along with the swhash_mtx. o Remove some duplicate assertions for swap_pager_freespace() and swap_pager_unswapped() but keep the object locking references for documentation. Sponsored by: EMC / Isilon storage division Reviewed by: alc Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue May 28 22:00:37 2013 (r251076) +++ head/sys/vm/swap_pager.c Tue May 28 22:07:23 2013 (r251077) @@ -822,12 +822,13 @@ swp_pager_freeswapspace(daddr_t blk, int * The external callers of this routine typically have already destroyed * or renamed vm_page_t's associated with this range in the object so * we should be ok. + * + * The object must be locked. */ void swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size) { - VM_OBJECT_ASSERT_WLOCKED(object); swp_pager_meta_free(object, start, size); } @@ -999,7 +1000,7 @@ swap_pager_haspage(vm_object_t object, v { daddr_t blk0; - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); /* * do we have good backing store at the requested index ? */ @@ -1065,12 +1066,13 @@ swap_pager_haspage(vm_object_t object, v * depends on it. * * This routine may not sleep. + * + * The object containing the page must be locked. */ static void swap_pager_unswapped(vm_page_t m) { - VM_OBJECT_ASSERT_WLOCKED(m->object); swp_pager_meta_ctl(m->object, m->pindex, SWM_FREE); } @@ -1916,7 +1918,7 @@ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t index, daddr_t count) { - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); if (object->type != OBJT_SWAP) return; @@ -2021,7 +2023,7 @@ swp_pager_meta_ctl(vm_object_t object, v daddr_t r1; int idx; - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); /* * The meta data only exists of the object is OBJT_SWAP * and even then might not be allocated yet.