logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

vm_page_grab — returns a page from an object

Authors

       This manual page was written by Chad David <davidc@acns.ab.ca>.

Debian                                           August 23, 2013                                 VM_PAGE_GRAB(9)

Description

       The  vm_page_grab() function returns the page at pindex from the given object.  If the page exists and is
       busy, vm_page_grab() will sleep while waiting for it.  If the page does not exist, it is allocated.   The
       function sleeps until the allocation request can be satisfied.

       The  function  requires  the  object  to  be locked on entry, and returns with the object locked.  If the
       vm_page_grab() function sleeps for any reason, the object lock is temporary dropped.

       The vm_page_grab() supports all of the flags supported by vm_page_alloc(9).  In addition,  vm_page_grab()
       supports the following flags:

       VM_ALLOC_IGN_SBUSY  When  waiting  for  the  busy  state  of  the  existing  page to drain, only test for
                           exclusive busy; ignore the shared busy counter.

Name

       vm_page_grab — returns a page from an object

Return Values

       The vm_page_grab() always returns the page.

See Also

vm_page_alloc(9)

Synopsis

#include<sys/param.h>#include<vm/vm.h>#include<vm/vm_page.h>vm_page_tvm_page_grab(vm_object_tobject, vm_pindex_tpindex, intallocflags);

See Also