UVM_OBJ_WIREPAGES(9)

UVM_OBJ_WIREPAGES(9) | Kernel Developer's Manual | UVM_OBJ_WIREPAGES(9)

# NAME

`uvm_obj_wirepages` `uvm_obj_unwirepages` — temporarily wire pages of a UVM object into RAM

# SYNOPSIS

`#include <uvm/uvm_extern.h>`

int
`uvm_obj_wirepages`(struct uvm_object *uobj, off_t start, off_t end, struct pglist *list);

void
`uvm_obj_unwirepages`(struct uvm_object *uobj, off_t start, off_t end);

# DESCRIPTION

`uvm_obj_wirepages`() temporarily wires a range of pages in a UVM object into RAM. If any pages from start (inclusive) to end (exclusive) are currently paged out, it pages them back in first, and arranges that the pages in the range will not be paged out until unwired with `uvm_obj_unwirepages`().

If list is nonnull, it is initialized to a tailq of pages linked through the pageq.queue member of struct vm_page, for the convenience of the caller. The caller is not transferred ownership of any part of list and need not free anything afterward — `uvm_obj_unwirepages`() will free the pages when done.

start and end must be page-aligned.

Calls to `uvm_obj_wirepages`() must be matched by `uvm_obj_unwirepages`() with the same range.

Overlapping ranges may be simultaneously wired; each page may be wired up to 2^32 - 1 times, and will not be paged out until all ranges covering it have been unwired.

# RETURN VALUES

The `uvm_obj_wirepages`() function returns zero on success, or returns an errno(3) error code and leaves the wired status of all pages unchanged on failure.

# SEE ALSO

mlock(3), uvm(9), uvm_map(9)

June 14, 2024 | NetBSD 11.0