kernel - Fix swapcached problems when max-swap use reached (2)
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 18 Nov 2011 19:51:18 +0000 (11:51 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 18 Nov 2011 19:51:18 +0000 (11:51 -0800)
* Fix bug in last commit

sys/vm/vm_swapcache.c

index b62158b..94dcb3f 100644 (file)
@@ -678,11 +678,13 @@ vm_swapcache_cleaning(vm_object_t marker)
                 * requested number of blocks, it will return n >= count
                 * and we break and pick it back up on a future attempt.
                 */
+               vm_object_lock_swap();
                lwkt_reltoken(&vmobj_token);
+
                n = swap_pager_condfree(object, &marker->size, count);
-               lwkt_gettoken(&vmobj_token);
 
                vm_object_drop(object);
+               lwkt_gettoken(&vmobj_token);
        
                count -= n;
                if (count < 0)