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.)
This commit is contained in:
Alan Cox 2003-01-16 08:14:56 +00:00
parent 4bf463ac4d
commit 6eb07b4ac2

View File

@ -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;
}