diff options
author | jeff <jeff@FreeBSD.org> | 2002-06-25 22:01:12 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-06-25 22:01:12 +0000 |
commit | 7083248242e1c7a83b28b1fc65d49288d0194900 (patch) | |
tree | 6911baf7cc0bdde0a2e7f08b609c4939ae15e41d | |
parent | e9c6c8e0fd0524a17ece1b6f788a73d3de264304 (diff) | |
download | FreeBSD-src-7083248242e1c7a83b28b1fc65d49288d0194900.zip FreeBSD-src-7083248242e1c7a83b28b1fc65d49288d0194900.tar.gz |
Turn VM_ALLOC_ZERO into a flag.
Submitted by: tegge
Reviewed by: dillon
-rw-r--r-- | sys/vm/vm_page.c | 10 | ||||
-rw-r--r-- | sys/vm/vm_page.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index d984e24..0e5380c 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -825,6 +825,7 @@ vm_page_t vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int page_req) { vm_page_t m = NULL; + boolean_t prefer_zero; int s; GIANT_REQUIRED; @@ -832,6 +833,9 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int page_req) KASSERT(!vm_page_lookup(object, pindex), ("vm_page_alloc: page already allocated")); + prefer_zero = (page_req & VM_ALLOC_ZERO) != 0 ? TRUE : FALSE; + page_req &= ~VM_ALLOC_ZERO; + /* * The pager is allowed to eat deeper into the free page list. */ @@ -847,10 +851,8 @@ loop: * Allocate from the free queue if there are plenty of pages * in it. */ - if (page_req == VM_ALLOC_ZERO) - m = vm_page_select_free(object, pindex, TRUE); - else - m = vm_page_select_free(object, pindex, FALSE); + + m = vm_page_select_free(object, pindex, prefer_zero); } else if ( (page_req == VM_ALLOC_SYSTEM && cnt.v_cache_count == 0 && diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index ee0509d..7e0fff8 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -305,7 +305,7 @@ extern long first_page; /* first physical page number */ #define VM_ALLOC_NORMAL 0 #define VM_ALLOC_INTERRUPT 1 #define VM_ALLOC_SYSTEM 2 -#define VM_ALLOC_ZERO 3 +#define VM_ALLOC_ZERO 0x40 #define VM_ALLOC_RETRY 0x80 void vm_page_flag_set(vm_page_t m, unsigned short bits); |