summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-01-08 19:58:42 +0000
committeralc <alc@FreeBSD.org>2003-01-08 19:58:42 +0000
commit03f7564d9e62f81ebe5702c3294d62c1ef3a644f (patch)
tree84255a8bc5f6f6a61e36e8bb4d028b675f350221 /sys/vm
parentd635237b70c5601805bde1ca841cb31706e7f027 (diff)
downloadFreeBSD-src-03f7564d9e62f81ebe5702c3294d62c1ef3a644f.zip
FreeBSD-src-03f7564d9e62f81ebe5702c3294d62c1ef3a644f.tar.gz
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.
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 bc34dc6..5bd612a 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);
/*
OpenPOWER on IntegriCloud