2 .\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice(s), this list of conditions and the following disclaimer as
9 .\" the first lines of this file unmodified other than the possible
10 .\" addition of one or more copyright notices.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice(s), this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
16 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 .\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
19 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22 .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
32 .Nm vm_page_set_validclean ,
33 .Nm vm_page_clear_dirty ,
34 .Nm vm_page_set_invalid ,
35 .Nm vm_page_zero_invalid ,
36 .Nm vm_page_is_valid ,
37 .Nm vm_page_test_dirty ,
40 .Nd "manage page clean and dirty bits"
46 .Fn vm_page_bits "int base" "int size"
48 .Fn vm_page_set_validclean "vm_page_t m" "int base" "int size"
50 .Fn vm_page_clear_dirty "vm_page_t m" "int base" "int size"
52 .Fn vm_page_set_invalid "vm_page_t m" "int base" "int size"
54 .Fn vm_page_zero_invalid "vm_page_t m" "boolean_t setvalid"
56 .Fn vm_page_is_valid "vm_page_t m" "int base" "int size"
58 .Fn vm_page_test_dirty "vm_page_t m"
60 .Fn vm_page_dirty "vm_page_t m"
62 .Fn vm_page_undirty "vm_page_t m"
65 calculates the bits representing the
67 range of bytes between
71 The byte range is expected to be within a single page, and if
73 is zero, no bits will be set.
75 .Fn vm_page_set_validclean
76 flags the byte range between
81 The range is expected to be
83 aligned and no larger than
85 If it is not properly aligned, any unaligned chunks of the
87 blocks at the beginning and end of the range will be zeroed.
93 is one page, the modified bit in the page map is cleared; as well,
98 .Fn vm_page_clear_dirty
99 clears the dirty bits within a page in the range between
103 The bits representing the range are calculated by calling
106 .Fn vm_page_set_invalid
107 clears the bits in both the valid and dirty flags representing
115 The bits are calculated by calling
117 As well as clearing the bits within the page, the generation
118 number within the object holding the page is incremented.
120 .Fn vm_page_zero_invalid
121 zeroes all of the blocks within the page that are currently
127 all of the valid bits within the page are set.
129 In some cases, such as NFS, the valid bits cannot be set
130 in order to maintain cache consistency.
133 checks to determine if the all of the
139 of the page are valid.
142 is zero and the page is entirely invalid
146 in all other cases a size of zero will return
149 .Fn vm_page_test_dirty
150 checks if a page has been modified via any of its physical maps,
151 and if so, flags the entire page as dirty.
153 is called to modify the dirty bits.
156 flags the entire page as dirty.
157 It is expected that the page is not currently on the cache queue.
160 clears all of the dirty bits in a page.
162 None of these functions are allowed to block.
164 This manual page was written by
165 .An Chad David Aq Mt davidc@acns.ab.ca .