* vm_object_page_noreuse: * * For the given object, attempt to move the specified pages to * the head of the inactive queue. This bypasses regular LRU * operation and allows the pages to be reused quickly under memory * pressure. If a page is wired for any reason, then it will not * be queued. Pages are specified by the range ["start", "end"). * As a special case, if "end" is zero, then
| 2161 | * The object must be locked. |
| 2162 | */ |
| 2163 | void |
| 2164 | vm_object_page_noreuse(vm_object_t object, vm_pindex_t start, vm_pindex_t end) |
| 2165 | { |
| 2166 | vm_page_t p, next; |
| 2167 | |
| 2168 | VM_OBJECT_ASSERT_LOCKED(object); |
| 2169 | KASSERT((object->flags & (OBJ_FICTITIOUS | OBJ_UNMANAGED)) == 0, |
| 2170 | ("vm_object_page_noreuse: illegal object %p", object)); |
| 2171 | if (object->resident_page_count == 0) |
| 2172 | return; |
| 2173 | p = vm_page_find_least(object, start); |
| 2174 | |
| 2175 | /* |
| 2176 | * Here, the variable "p" is either (1) the page with the least pindex |
| 2177 | * greater than or equal to the parameter "start" or (2) NULL. |
| 2178 | */ |
| 2179 | for (; p != NULL && (p->pindex < end || end == 0); p = next) { |
| 2180 | next = TAILQ_NEXT(p, listq); |
| 2181 | vm_page_deactivate_noreuse(p); |
| 2182 | } |
| 2183 | } |
| 2184 | |
| 2185 | /* |
| 2186 | * Populate the specified range of the object with valid pages. Returns |
no test coverage detected