Reorganize UFP_* flags with markup and more detail.

This commit is contained in:
riastradh 2015-03-23 08:19:12 +00:00
parent 0e9029ef91
commit d06a75e7df

View File

@ -1,4 +1,4 @@
.\" $NetBSD: uvm.9,v 1.109 2015/03/23 08:11:10 wiz Exp $ .\" $NetBSD: uvm.9,v 1.110 2015/03/23 08:19:12 riastradh Exp $
.\" .\"
.\" Copyright (c) 1998 Matthew R. Green .\" Copyright (c) 1998 Matthew R. Green
.\" All rights reserved. .\" All rights reserved.
@ -459,43 +459,42 @@ must be a vnode object.
The number of pages requested is pointed to by The number of pages requested is pointed to by
.Fa npagesp , .Fa npagesp ,
and this value is updated with the actual number of pages returned. and this value is updated with the actual number of pages returned.
The flags can be The flags can be any bitwise inclusive-or of:
.Bd -literal
#define UFP_ALL 0x00 /* return all pages requested */
#define UFP_NOWAIT 0x01 /* don't sleep */
#define UFP_NOALLOC 0x02 /* don't allocate new pages */
#define UFP_NOCACHE 0x04 /* don't return pages which already exist */
#define UFP_NORDONLY 0x08 /* don't return PG_READONLY pages */
#define UFP_DIRTYONLY 0x10 /* stop at first clean pg, clean dirty pgs */
#define UFP_BACKWARD 0x20 /* find pages in reverse order */
.Ed
.Pp .Pp
.Dv UFP_ALL .Bl -tag -offset abcd -compact -width UVM_ADV_SEQUENTIAL
is a pseudo-flag meaning all requested pages should be returned. .It Dv UFP_ALL
.Dv UFP_NOWAIT Zero pseudo-flag meaning return all pages.
means that we must not sleep. .It Dv UFP_NOWAIT
.Dv UFP_NOALLOC Don't sleep -- yield
causes any pages which do not already exist to be skipped. .Dv NULL
.Dv UFP_NOCACHE for busy pages or for uncached pages for which allocation would sleep.
causes any pages which do already exist to be skipped. .It Dv UFP_NOALLOC
.Dv UFP_NORDONLY Don't allocate -- yield
causes any pages which are marked PG_READONLY to be skipped. .Dv NULL
.Dv UFP_DIRTYONLY for uncached pages.
causes .It Dv UFP_NOCACHE
.Fn uvn_findpages Don't use cached pages -- yield
to stop early at the first clean page, and as a side effect to mark .Dv NULL
each dirty page as clean. instead.
It is the caller's responsibility to write the pages back to permanent .It Dv UFP_NORDONLY
storage before unbusying them. Don't yield read-only pages -- yield
.Dv UFP_BACKWARD .Dv NULL
causes for pages marked
.Fn uvn_findpages .Dv PG_READONLY .
to traverse the array of pages in reverse order, starting at the end. .It Dv UFP_DIRTYONLY
Don't yield clean pages -- stop early at the first clean one.
As a side effect, mark yielded dirty pages clean.
Caller must write them to permanent storage before unbusying.
.It Dv UFP_BACKWARD
Traverse pages in reverse order.
If If
.Fn uvn_findpages .Fn uvn_findpages
returns early in this case, it will have filled returns early, it will have filled
.Li * Ns Fa npagesp .Li * Ns Fa npagesp
entries at the end rather than beginning of the page array. entries at the end of
.Fa pps
rather than the beginning.
.El
.Pp .Pp
.Fn uvm_vnp_setsize .Fn uvm_vnp_setsize
sets the size of vnode sets the size of vnode