MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_object_page_noreuse

Function vm_object_page_noreuse

freebsd/vm/vm_object.c:2163–2183  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

2161 * The object must be locked.
2162 */
2163void
2164vm_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

Callers 1

vop_stdadviseFunction · 0.85

Calls 2

vm_page_find_leastFunction · 0.85

Tested by

no test coverage detected