summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-01-16 08:14:56 +0000
committeralc <alc@FreeBSD.org>2003-01-16 08:14:56 +0000
commitb8c33f3dc0384ae66364c488f624937f8511e3dc (patch)
tree824c45ab922017f5ba1e10bc0351c01b53288536 /sys/kern
parentf8813cf88ce7c442900d803cf767a60ec43903d1 (diff)
downloadFreeBSD-src-b8c33f3dc0384ae66364c488f624937f8511e3dc.zip
FreeBSD-src-b8c33f3dc0384ae66364c488f624937f8511e3dc.tar.gz
Fix two long-standing, but likely harmless, errors in the use of
vm_pageout_deficit: 1. Update vm_pageout_deficit before VM_WAIT. There is no sense in delaying the update; the sooner the pageout daemon receives this information the better. Reviewed by: tegge 2. Update vm_pageout_deficit according to the number of pages still needed to complete the allocation, not the original size of the allocation. Submitted by: tegge (These errors have existed since the introduction of vm_pageout_deficit in revision 1.144.)
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_bio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 01f1795..1f1914c 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -2756,9 +2756,9 @@ allocbuf(struct buf *bp, int size)
m = vm_page_alloc(obj, pi,
VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
if (m == NULL) {
- VM_WAIT;
atomic_add_int(&vm_pageout_deficit,
desiredpages - bp->b_npages);
+ VM_WAIT;
} else {
vm_page_lock_queues();
vm_page_wakeup(m);
@@ -3490,7 +3490,7 @@ tryagain:
vm_object_unlock(kernel_object);
if (!p) {
atomic_add_int(&vm_pageout_deficit,
- (to - from) >> PAGE_SHIFT);
+ (to - pg) >> PAGE_SHIFT);
VM_WAIT;
goto tryagain;
}
OpenPOWER on IntegriCloud