Changeset View
Changeset View
Standalone View
Standalone View
head/share/man/man9/vm_page_alloc.9
Show All 20 Lines | |||||
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||||
.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||||
.\" DAMAGE. | .\" DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd January 28, 2012 | .Dd November 16, 2016 | ||||
.Dt VM_PAGE_ALLOC 9 | .Dt VM_PAGE_ALLOC 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm vm_page_alloc | .Nm vm_page_alloc | ||||
.Nd "allocate a page for a" | .Nd "allocate a page for a" | ||||
.Vt vm_object | .Vt vm_object | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
Show All 9 Lines | |||||
within | within | ||||
.Fa object . | .Fa object . | ||||
It is assumed that a page has not already been allocated at | It is assumed that a page has not already been allocated at | ||||
.Fa pindex . | .Fa pindex . | ||||
The page returned is inserted into the object, unless | The page returned is inserted into the object, unless | ||||
.Dv VM_ALLOC_NOOBJ | .Dv VM_ALLOC_NOOBJ | ||||
is specified in the | is specified in the | ||||
.Fa req . | .Fa 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. | |||||
.Pp | .Pp | ||||
.Fn vm_page_alloc | .Fn vm_page_alloc | ||||
will not sleep. | will not sleep. | ||||
.Pp | .Pp | ||||
Its arguments are: | Its arguments are: | ||||
.Bl -tag -width ".Fa object" | .Bl -tag -width ".Fa object" | ||||
.It Fa object | .It Fa object | ||||
The VM object to allocate the page for. | The VM object to allocate the page for. | ||||
Show All 19 Lines | |||||
.It Dv VM_ALLOC_INTERRUPT | .It Dv VM_ALLOC_INTERRUPT | ||||
.Fn vm_page_alloc | .Fn vm_page_alloc | ||||
is being called during an interrupt. | is being called during an interrupt. | ||||
A page will be returned successfully if the free page count is greater | A page will be returned successfully if the free page count is greater | ||||
than zero. | than zero. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
The optional flags are: | The optional flags are: | ||||
.Bl -tag -width ".Dv VM_ALLOC_IFNOTCACHED" | .Bl -tag -width ".Dv VM_ALLOC_NOBUSY" | ||||
.It Dv VM_ALLOC_NOBUSY | .It Dv VM_ALLOC_NOBUSY | ||||
The returned page will not be exclusive busy. | The returned page will not be exclusive busy. | ||||
.It Dv VM_ALLOC_NODUMP | .It Dv VM_ALLOC_NODUMP | ||||
The returned page will not be included in any kernel core dumps | The returned page will not be included in any kernel core dumps | ||||
regardless of whether or not it is mapped in to KVA. | regardless of whether or not it is mapped in to KVA. | ||||
.It Dv VM_ALLOC_NOOBJ | .It Dv VM_ALLOC_NOOBJ | ||||
Do not associate the allocated page with a vm object. | Do not associate the allocated page with a vm object. | ||||
The | The | ||||
.Fa object | .Fa object | ||||
argument is ignored. | argument is ignored. | ||||
.It Dv VM_ALLOC_IFCACHED | |||||
Allocate the page only if it is cached. | |||||
Otherwise, return | |||||
.Dv NULL . | |||||
.It Dv VM_ALLOC_IFNOTCACHED | |||||
Only allocate the page if it is not cached in the | |||||
.Fa object . | |||||
If the page at the specified | |||||
.Fa pindex | |||||
is cached, NULL is returned instead. | |||||
.It Dv VM_ALLOC_SBUSY | .It Dv VM_ALLOC_SBUSY | ||||
The returned page will be shared busy. | The returned page will be shared busy. | ||||
.It Dv VM_ALLOC_WIRED | .It Dv VM_ALLOC_WIRED | ||||
The returned page will be wired. | The returned page will be wired. | ||||
.It Dv VM_ALLOC_ZERO | .It Dv VM_ALLOC_ZERO | ||||
Indicate a preference for a pre-zeroed page. | Indicate a preference for a pre-zeroed page. | ||||
There is no guarantee that the returned page will be zeroed, but it | There is no guarantee that the returned page will be zeroed, but it | ||||
will have the | will have the | ||||
Show All 19 Lines |