summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-07-09 19:38:30 +0000
committeralc <alc@FreeBSD.org>2010-07-09 19:38:30 +0000
commit7c09dc242c035943fb8ed54909fd0a8461cb99ba (patch)
tree59894efa2a34a762f15c9dc8d9456b6f9e56f524 /sys/kern/vfs_bio.c
parent4ef0eb46da85379be188033bd5af465eaa2f1b0d (diff)
downloadFreeBSD-src-7c09dc242c035943fb8ed54909fd0a8461cb99ba.zip
FreeBSD-src-7c09dc242c035943fb8ed54909fd0a8461cb99ba.tar.gz
Add support for the VM_ALLOC_COUNT() hint to vm_page_alloc(). Consequently,
the maintenance of vm_pageout_deficit can be localized to just two places: vm_page_alloc() and vm_pageout_scan(). This change also corrects an off-by-one error in the maintenance of vm_pageout_deficit. Historically, the buffer cache functions, allocbuf() and vm_hold_load_pages(), have not taken into account that vm_page_alloc() already increments vm_pageout_deficit by one. Reviewed by: kib
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 762b253..9d2beba 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -3752,10 +3752,9 @@ tryagain:
* process we are.
*/
p = vm_page_alloc(NULL, pg >> PAGE_SHIFT, VM_ALLOC_NOOBJ |
- VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
+ VM_ALLOC_SYSTEM | VM_ALLOC_WIRED |
+ VM_ALLOC_COUNT((to - pg) >> PAGE_SHIFT));
if (!p) {
- atomic_add_int(&vm_pageout_deficit,
- (to - pg) >> PAGE_SHIFT);
VM_WAIT;
goto tryagain;
}
OpenPOWER on IntegriCloud