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.
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to