aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2003-01-08 19:58:42 +0000
committerAlan Cox <alc@FreeBSD.org>2003-01-08 19:58:42 +0000
commit9a032278bded989ec63998a2fa88e66ec40f768b (patch)
tree84255a8bc5f6f6a61e36e8bb4d028b675f350221 /sys/vm
parent338633abf8ec34cbdadfe97e77893118a5f51ede (diff)
downloadsrc-9a032278bded989ec63998a2fa88e66ec40f768b.tar.gz
src-9a032278bded989ec63998a2fa88e66ec40f768b.zip
In vm_page_alloc(), honor VM_ALLOC_ZERO for system and interrupt class
requests when the number of free pages is below the reserved threshold. Previously, VM_ALLOC_ZERO was only honored when the number of free pages was above the reserved threshold. Honoring it in all cases generally makes sense, does no harm, and simplifies the code.
Notes
Notes: svn path=/head/; revision=108963
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_page.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index bc34dc64281a..5bd612a325b5 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -785,23 +785,16 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req)
s = splvm();
loop:
mtx_lock_spin(&vm_page_queue_free_mtx);
- if (cnt.v_free_count > cnt.v_free_reserved) {
- /*
- * Allocate from the free queue if there are plenty of pages
- * in it.
- */
- m = vm_page_select_free(color, (req & VM_ALLOC_ZERO) != 0);
-
- } else if (
+ if (cnt.v_free_count > cnt.v_free_reserved ||
(page_req == VM_ALLOC_SYSTEM &&
cnt.v_cache_count == 0 &&
cnt.v_free_count > cnt.v_interrupt_free_min) ||
- (page_req == VM_ALLOC_INTERRUPT && cnt.v_free_count > 0)
- ) {
+ (page_req == VM_ALLOC_INTERRUPT && cnt.v_free_count > 0)) {
/*
- * Interrupt or system, dig deeper into the free list.
+ * Allocate from the free queue if the number of free pages
+ * exceeds the minimum for the request class.
*/
- m = vm_page_select_free(color, FALSE);
+ m = vm_page_select_free(color, (req & VM_ALLOC_ZERO) != 0);
} else if (page_req != VM_ALLOC_INTERRUPT) {
mtx_unlock_spin(&vm_page_queue_free_mtx);
/*