kernel - Remove unneeded get_mplock() wrappers near tokens
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Aug 2010 15:13:43 +0000 (08:13 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Aug 2010 15:13:43 +0000 (08:13 -0700)
* The xx_tokens replace the mplock functionality (and for now
  they still get the mplock), so clean these up.

sys/vm/vm_pageout.c
sys/vm/vm_swapcache.c

index c68ef8a..452bd6d 100644 (file)
@@ -1483,7 +1483,6 @@ vm_pageout_thread(void)
        /*
         * Permanently hold vm_token.
         */
-       get_mplock();
        lwkt_gettoken(&vm_token);
 
        /*
index 235b40b..5eee72c 100644 (file)
@@ -155,9 +155,8 @@ vm_swapcached_thread(void)
         */
        curthread->td_flags |= TDF_SYSTHREAD;
 
-       get_mplock();
-       crit_enter();
        lwkt_gettoken(&vm_token);
+       crit_enter();
 
        /*
         * Initialize our marker for the inactive scan (SWAPC_WRITING)
@@ -241,12 +240,17 @@ vm_swapcached_thread(void)
                        vm_swapcache_cleaning(&object_marker);
                }
        }
+
+       /*
+        * Cleanup (NOT REACHED)
+        */
        TAILQ_REMOVE(INACTIVE_LIST, &page_marker, pageq);
+       crit_exit();
+       lwkt_reltoken(&vm_token);
+
        lwkt_gettoken(&vmobj_token);
        TAILQ_REMOVE(&vm_object_list, &object_marker, object_list);
        lwkt_reltoken(&vmobj_token);
-       lwkt_reltoken(&vm_token);
-       crit_exit();
 }
 
 static struct kproc_desc swpc_kp = {