summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-05-05 03:45:46 +0000
committeralc <alc@FreeBSD.org>2010-05-05 03:45:46 +0000
commitea7b6345be41650b664c9b86b93526b79177c75f (patch)
tree20d3f2d2748e5c26aa0ee168b8337650bc8905cd /sys/kern/vfs_bio.c
parent30b63b91fa4784d0199bd0f95c61f2b6acaf8603 (diff)
downloadFreeBSD-src-ea7b6345be41650b664c9b86b93526b79177c75f.zip
FreeBSD-src-ea7b6345be41650b664c9b86b93526b79177c75f.tar.gz
Push down the acquisition of the page queues lock into vm_page_unwire().
Update the comment describing which lock should be held on entry to vm_page_wire(). Reviewed by: kib
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 589bdbd..ec8ad67 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1571,7 +1571,6 @@ vfs_vmio_release(struct buf *bp)
* everything on the inactive queue.
*/
vm_page_lock(m);
- vm_page_lock_queues();
vm_page_unwire(m, 0);
/*
* We don't mess with busy pages, it is
@@ -1580,6 +1579,7 @@ vfs_vmio_release(struct buf *bp)
*/
if ((m->oflags & VPO_BUSY) == 0 && m->busy == 0 &&
m->wire_count == 0) {
+ vm_page_lock_queues();
/*
* Might as well free the page if we can and it has
* no valid data. We also free the page if the
@@ -1593,8 +1593,8 @@ vfs_vmio_release(struct buf *bp)
} else if (buf_vm_page_count_severe()) {
vm_page_try_to_cache(m);
}
+ vm_page_unlock_queues();
}
- vm_page_unlock_queues();
vm_page_unlock(m);
}
VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object);
@@ -2957,9 +2957,7 @@ allocbuf(struct buf *bp, int size)
bp->b_pages[i] = NULL;
vm_page_lock(m);
- vm_page_lock_queues();
vm_page_unwire(m, 0);
- vm_page_unlock_queues();
vm_page_unlock(m);
}
VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object);
OpenPOWER on IntegriCloud