kernel - Fix incorrectly ordered lwkt_reltoken() call in pageout daemon
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 28 Feb 2013 17:01:04 +0000 (09:01 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 28 Feb 2013 17:14:48 +0000 (09:14 -0800)
* The pageout daemon was incorrectly swapping the top two VM objects
  in order to drop the prior object in a specific case where the 'new'
  object being rotated into is NULL.

sys/vm/vm_pageout.c

index 8ee319b..b635665 100644 (file)
@@ -527,13 +527,15 @@ vm_pageout_object_deactivate_pages(vm_map_t map, vm_object_t object,
                        vm_object_drop(tobject);
                }
                if (lobject != object) {
-                       vm_object_lock_swap();
+                       if (tobject)
+                               vm_object_lock_swap();
                        vm_object_drop(lobject);
+                       /* leaves tobject locked & at top */
                }
                lobject = tobject;
        }
        if (lobject != object)
-               vm_object_drop(lobject);
+               vm_object_drop(lobject);        /* NULL ok */
 }
 
 /*