kernel -- vm: Restore vm_token in page fault path.
authorVenkatesh Srinivas <me@endeavour.zapto.org>
Tue, 14 Jun 2011 03:59:59 +0000 (20:59 -0700)
committerVenkatesh Srinivas <me@endeavour.zapto.org>
Tue, 14 Jun 2011 03:59:59 +0000 (20:59 -0700)
This partly reverts b4460ab356b9d7f1bd11c8badbf2a6dc97a7776f. The vm_object has
not been fully tokenized, so removing vm_token takes there was premature.

sys/vm/vm_fault.c

index b98dd11..f5f5f25 100644 (file)
@@ -357,11 +357,13 @@ RetryFault:
         *
         * The vm_object must be held before manipulation.
         */
+       lwkt_gettoken(&vm_token);
        vm_object_hold(fs.first_object);
        vm_object_reference(fs.first_object);
        fs.vp = vnode_pager_lock(fs.first_object);
        vm_object_pip_add(fs.first_object, 1);
        vm_object_drop(fs.first_object);
+       lwkt_reltoken(&vm_token);
 
        fs.lookup_still_valid = TRUE;
        fs.first_m = NULL;
@@ -587,11 +589,13 @@ RetryFault:
         *
         * The vm_object must be held before manipulation.
         */
+       lwkt_gettoken(&vm_token);
        vm_object_hold(fs.first_object);
        vm_object_reference(fs.first_object);
        fs.vp = vnode_pager_lock(fs.first_object);
        vm_object_pip_add(fs.first_object, 1);
        vm_object_drop(fs.first_object);
+       lwkt_reltoken(&vm_token);
 
        fs.lookup_still_valid = TRUE;
        fs.first_m = NULL;
@@ -746,11 +750,13 @@ RetryFault:
         * truncation operations) during I/O.  This must be done after
         * obtaining the vnode lock in order to avoid possible deadlocks.
         */
+       lwkt_gettoken(&vm_token);
        vm_object_hold(fs.first_object);
        vm_object_reference(fs.first_object);
        fs.vp = vnode_pager_lock(fs.first_object);
        vm_object_pip_add(fs.first_object, 1);
        vm_object_drop(fs.first_object);
+       lwkt_reltoken(&vm_token);
 
        fs.lookup_still_valid = TRUE;
        fs.first_m = NULL;