Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/vm_page_busy.9
Show All 18 Lines | |||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||||
.\" 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 August 07, 2013 | .Dd November 11, 2021 | ||||
.Dt VM_PAGE_BUSY 9 | .Dt VM_PAGE_BUSY 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm vm_page_busied , | .Nm vm_page_busied , | ||||
.Nm vm_page_busy_downgrade , | .Nm vm_page_busy_downgrade , | ||||
.Nm vm_page_busy_sleep , | .Nm vm_page_busy_sleep , | ||||
.Nm vm_page_sbusied , | .Nm vm_page_sbusied , | ||||
.Nm vm_page_sbusy , | .Nm vm_page_sbusy , | ||||
.Nm vm_page_sleep_if_busy , | |||||
.Nm vm_page_sunbusy , | .Nm vm_page_sunbusy , | ||||
.Nm vm_page_trysbusy , | .Nm vm_page_trysbusy , | ||||
.Nm vm_page_tryxbusy , | .Nm vm_page_tryxbusy , | ||||
.Nm vm_page_xbusied , | .Nm vm_page_xbusied , | ||||
.Nm vm_page_xbusy , | .Nm vm_page_xbusy , | ||||
.Nm vm_page_xunbusy , | .Nm vm_page_xunbusy , | ||||
.Nm vm_page_assert_sbusied , | .Nm vm_page_assert_sbusied , | ||||
.Nm vm_page_assert_unbusied , | .Nm vm_page_assert_unbusied , | ||||
.Nm vm_page_assert_xbusied | .Nm vm_page_assert_xbusied | ||||
.Nd protect page identity changes and page content references | .Nd protect page identity changes and page content references | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
.In vm/vm.h | .In vm/vm.h | ||||
.In vm/vm_page.h | .In vm/vm_page.h | ||||
.Ft int | .Ft int | ||||
.Fn vm_page_busied "vm_page_t m" | .Fn vm_page_busied "vm_page_t m" | ||||
.Ft void | .Ft void | ||||
.Fn vm_page_busy_downgrade "vm_page_t m" | .Fn vm_page_busy_downgrade "vm_page_t m" | ||||
.Ft void | .Ft bool | ||||
.Fn vm_page_busy_sleep "vm_page_t m" "const char *msg" | .Fn vm_page_busy_sleep "vm_page_t m" "const char *msg" "int allocflags" | ||||
.Ft int | .Ft int | ||||
.Fn vm_page_sbusied "vm_page_t m" | .Fn vm_page_sbusied "vm_page_t m" | ||||
.Ft void | .Ft void | ||||
.Fn vm_page_sbusy "vm_page_t m" | .Fn vm_page_sbusy "vm_page_t m" | ||||
.Ft int | |||||
.Fn vm_page_sleep_if_busy "vm_page_t m" "const char *msg" | |||||
.Ft void | .Ft void | ||||
.Fn vm_page_sunbusy "vm_page_t m" | .Fn vm_page_sunbusy "vm_page_t m" | ||||
.Ft int | .Ft int | ||||
.Fn vm_page_trysbusy "vm_page_t m" | .Fn vm_page_trysbusy "vm_page_t m" | ||||
.Ft int | .Ft int | ||||
.Fn vm_page_tryxbusy "vm_page_t m" | .Fn vm_page_tryxbusy "vm_page_t m" | ||||
.Ft int | .Ft int | ||||
.Fn vm_page_xbusied "vm_page_t m" | .Fn vm_page_xbusied "vm_page_t m" | ||||
Show All 38 Lines | |||||
The | The | ||||
.Fn vm_page_busy_downgrade | .Fn vm_page_busy_downgrade | ||||
function must be used to downgrade | function must be used to downgrade | ||||
.Fa m | .Fa m | ||||
from an exclusive busy state to a shared busy state. | from an exclusive busy state to a shared busy state. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn vm_page_busy_sleep | .Fn vm_page_busy_sleep | ||||
function puts the invoking thread to sleep using the appropriate | checks the busy state of the page | ||||
waitchannels for the busy mechanism. | .Fa m | ||||
and puts the invoking thread to sleep if the page is busy. | |||||
The VM object for the page must be locked. | |||||
The | |||||
.Fa allocflags | |||||
parameter must be either | |||||
.Dv 0 , | |||||
in which case the function will sleep if the page is busied, | |||||
pauamma_gundo.com: "busied" | |||||
or | |||||
.Dv VM_ALLOC_IGN_SBUSY , | |||||
in which case the function will sleep only if the page is exclusively | |||||
busied. | |||||
Not Done Inline ActionsSame as above for "exclusively busied" pauamma_gundo.com: Same as above for "exclusively busied" | |||||
A return value of true indicates that the invoking thread was put to | |||||
sleep and that the object was unlocked. | |||||
A return value of false indicates that the invoking thread did not sleep | |||||
and the object remains locked. | |||||
The parameter | The parameter | ||||
.Fa msg | .Fa msg | ||||
is a string describing the sleep condition for userland tools. | is a string describing the sleep condition for userland tools. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn vm_page_busied | .Fn vm_page_busied | ||||
function returns non-zero if the current thread busied | function returns non-zero if the current thread busied | ||||
Not Done Inline Actions"busied" again, so I assume it wasn't a mistake above. pauamma_gundo.com: "busied" again, so I assume it wasn't a mistake above. | |||||
.Fa m | .Fa m | ||||
in shared mode. | in shared mode. | ||||
Returns zero otherwise. | Returns zero otherwise. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn vm_page_sbusy | .Fn vm_page_sbusy | ||||
function shared busies | function shared busies | ||||
.Fa m . | .Fa m . | ||||
.Pp | |||||
The | |||||
.Fn vm_page_sleep_if_busy | |||||
function puts the invoking thread to sleep, using the appropriate | |||||
waitchannels for the busy mechanism, if | |||||
.Fa m . | |||||
is busied in either exclusive or shared mode. | |||||
If the invoking thread slept a non-zero value is returned, otherwise | |||||
0 is returned. | |||||
The parameter | |||||
.Fa msg | |||||
is a string describing the sleep condition for userland tools. | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fn vm_page_sunbusy | .Fn vm_page_sunbusy | ||||
function shared unbusies | function shared unbusies | ||||
Not Done Inline Actions"unbusies" pauamma_gundo.com: "unbusies" | |||||
.Fa m . | .Fa m . | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn vm_page_trysbusy | .Fn vm_page_trysbusy | ||||
attempts to shared busy | attempts to shared busy | ||||
.Fa m . | .Fa m . | ||||
If the operation cannot immediately succeed | If the operation cannot immediately succeed | ||||
.Fn vm_page_trysbusy | .Fn vm_page_trysbusy | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |
"busied"