summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-10-25 06:34:14 +0000
committeralc <alc@FreeBSD.org>2004-10-25 06:34:14 +0000
commitc0959741f797bce5d58c6f799b3bc39a4905b2ca (patch)
treecf618c64731b7bce425e1c090fd381fa06836677 /sys/kern/vfs_bio.c
parent4ba53ec41b6cea4fe1d5f96985036c8d0e1e994b (diff)
downloadFreeBSD-src-c0959741f797bce5d58c6f799b3bc39a4905b2ca.zip
FreeBSD-src-c0959741f797bce5d58c6f799b3bc39a4905b2ca.tar.gz
Use VM_ALLOC_NOBUSY to eliminate vm_page_wakeup() calls and the acquisition
and release of the global page queues lock required to make the call. Remove GIANT_REQUIRED from vm_hold_free_pages(). All of its VM operations are properly synchronized.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index cf932b4..453ea5c 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -2882,7 +2882,8 @@ allocbuf(struct buf *bp, int size)
* process we are.
*/
m = vm_page_alloc(obj, pi,
- VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
+ VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM |
+ VM_ALLOC_WIRED);
if (m == NULL) {
atomic_add_int(&vm_pageout_deficit,
desiredpages - bp->b_npages);
@@ -2890,9 +2891,6 @@ allocbuf(struct buf *bp, int size)
VM_WAIT;
VM_OBJECT_LOCK(obj);
} else {
- vm_page_lock_queues();
- vm_page_wakeup(m);
- vm_page_unlock_queues();
bp->b_flags &= ~B_CACHE;
bp->b_pages[bp->b_npages] = m;
++bp->b_npages;
@@ -3623,7 +3621,7 @@ tryagain:
*/
p = vm_page_alloc(kernel_object,
((pg - VM_MIN_KERNEL_ADDRESS) >> PAGE_SHIFT),
- VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
+ VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
if (!p) {
atomic_add_int(&vm_pageout_deficit,
(to - pg) >> PAGE_SHIFT);
@@ -3635,9 +3633,6 @@ tryagain:
p->valid = VM_PAGE_BITS_ALL;
pmap_qenter(pg, &p, 1);
bp->b_pages[index] = p;
- vm_page_lock_queues();
- vm_page_wakeup(p);
- vm_page_unlock_queues();
}
VM_OBJECT_UNLOCK(kernel_object);
bp->b_npages = index;
@@ -3651,8 +3646,6 @@ vm_hold_free_pages(struct buf *bp, vm_offset_t from, vm_offset_t to)
vm_page_t p;
int index, newnpages;
- GIANT_REQUIRED;
-
from = round_page(from);
to = round_page(to);
newnpages = index = (from - trunc_page((vm_offset_t)bp->b_data)) >> PAGE_SHIFT;
OpenPOWER on IntegriCloud