vm_page_alloc
allocate a page for a vm_object
- Provided by: freebsd-manpages (Version: 9.2+1-1)
- Report a bug
allocate a page for a vm_object
#include
<sys/param.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
vm_page_t
vm_page_alloc(vm_object_t
object, vm_pindex_t
pindex, int
req);
The
vm_page_alloc()
function allocates a page at pindex within
object. It is assumed that a page has not already been
allocated at pindex. The page returned is inserted
into the object, unless VM_ALLOC_NOOBJ is specified
in the req. The page may exist in the vm object cache,
in which case it will be reactivated instead, moving from the cache into the
object page list.
vm_page_alloc()
will not sleep.
Its arguments are:
VM_ALLOC_NOOBJ is not
specified.Exactly one of the following classes must be specified:
VM_ALLOC_NORMALVM_ALLOC_SYSTEMVM_ALLOC_INTERRUPTvm_page_alloc()
is being called during an interrupt. A page will be returned
successfully if the free page count is greater than zero.The optional flags are:
VM_ALLOC_ZEROPG_ZERO flag set if it is zeroed.VM_ALLOC_NOOBJVM_ALLOC_NOBUSYVPO_BUSY
flag set.VM_ALLOC_WIREDVM_ALLOC_IFCACHEDNULL.VM_ALLOC_IFNOTCACHEDThe vm_page_t that was allocated is returned
if successful; otherwise, NULL is returned.
The pager process is always upgraded to
VM_ALLOC_SYSTEM unless
VM_ALLOC_INTERRUPT is set.
This manual page was written by Chad David ⟨davidc@acns.ab.ca⟩.