Copyright (C) 2001 Chad David <email@example.com>. All rights reserved. Copyright (c) 2013 The FreeBSD Foundation Portions of this documentation were written by Konstantin Belousov under sponsorship from the FreeBSD Foundation. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice(s), this list of conditions and the following di...
NAMEvm_page_grab - returns a page from an object
SYNOPSISIn sys/param.h In vm/vm.h In vm/vm_page.h Ft vm_page_t Fn vm_page_grab vm_object_t object vm_pindex_t pindex int allocflags
DESCRIPTIONThe Fn vm_page_grab function returns the page at Fa pindex from the given object. If the page exists and is busy, Fn 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 Fa object to be locked on entry, and returns with the object locked. If the Fn vm_page_grab function sleeps for any reason, the object lock is temporary dropped.
The Fn vm_page_grab supports all of the flags supported by vm_page_alloc9. In addition, Fn vm_page_grab supports the following flags:
- When waiting for the busy state of the existing page to drain, only test for exclusive busy; ignore the shared busy counter.