Turn VM_ALLOC_ZERO into a flag.

Submitted by:	tegge
Reviewed by:	dillon
This commit is contained in:
Jeff Roberson 2002-06-25 22:01:12 +00:00
parent 5c0e403ba2
commit e78f35b33f
2 changed files with 7 additions and 5 deletions

View File

@ -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 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int page_req)
* 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 &&

View File

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