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
34 .Nm vm_page_set_validclean ,
35 .Nm vm_page_clear_dirty ,
36 .Nm vm_page_set_invalid ,
37 .Nm vm_page_zero_invalid ,
38 .Nm vm_page_is_valid ,
39 .Nm vm_page_test_dirty ,
42 .Nd "manage page clean and dirty bits"
48 .Fn vm_page_bits "int base" "int size"
50 .Fn vm_page_set_validclean "vm_page_t m" "int base" "int size"
52 .Fn vm_page_clear_dirty "vm_page_t m" "int base" "int size"
54 .Fn vm_page_set_invalid "vm_page_t m" "int base" "int size"
56 .Fn vm_page_zero_invalid "vm_page_t m" "boolean_t setvalid"
58 .Fn vm_page_is_valid "vm_page_t m" "int base" "int size"
60 .Fn vm_page_test_dirty "vm_page_t m"
62 .Fn vm_page_dirty "vm_page_t m"
64 .Fn vm_page_undirty "vm_page_t m"
67 calculates the bits representing the
69 range of bytes between
73 The byte range is expected to be within a single page, and if
75 is zero, no bits will be set.
77 .Fn vm_page_set_validclean
78 flags the byte range between
83 The range is expected to be
85 aligned and no larger than
87 If it is not properly aligned, any unaligned chucks of the
89 blocks at the beginning and end of the range will be zeroed.
95 is one page, the modified bit in the page map is cleared; as well,
100 .Fn vm_page_clear_dirty
101 clears the dirty bits within a page in the range between
105 The bits representing the range are calculated by calling
108 .Fn vm_page_set_invalid
109 clears the bits in both the valid and dirty flags representing
117 The bits are calculated by calling
119 As well as clearing the bits within the page, the generation
120 number within the object holding the page is incremented.
122 .Fn vm_page_zero_invalid
123 zeroes all of the blocks within the page that are currently
129 all of the valid bits within the page are set.
131 In some cases, such as NFS, the valid bits cannot be set
132 in order to maintain cache consistency.
135 checks to determine if the all of the
141 of the page are valid.
144 is zero and the page is entirely invalid
148 in all other cases a size of zero will return
151 .Fn vm_page_test_dirty
152 checks if a page has been modified via any of its physical maps,
153 and if so, flags the entire page as dirty.
155 is called to modify the dirty bits.
158 flags the entire page as dirty.
159 It is expected that the page is not currently on the cache queue.
162 clears all of the dirty bits in a page.
164 None of these functions are allowed to block.
166 This manual page was written by
167 .An Chad David Aq davidc@acns.ab.ca .