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

Function vm_page_release

freebsd/vm/vm_page.c:4191–4216  ·  view source on GitHub ↗

* Unwire a page and either attempt to free it or re-add it to the page queues. */

Source from the content-addressed store, hash-verified

4189 * Unwire a page and either attempt to free it or re-add it to the page queues.
4190 */
4191void
4192vm_page_release(vm_page_t m, int flags)
4193{
4194 vm_object_t object;
4195
4196 KASSERT((m->oflags & VPO_UNMANAGED) == 0,
4197 ("vm_page_release: page %p is unmanaged", m));
4198
4199 if ((flags & VPR_TRYFREE) != 0) {
4200 for (;;) {
4201 object = atomic_load_ptr(&m->object);
4202 if (object == NULL)
4203 break;
4204 /* Depends on type-stability. */
4205 if (vm_page_busied(m) || !VM_OBJECT_TRYWLOCK(object))
4206 break;
4207 if (object == m->object) {
4208 vm_page_release_locked(m, flags);
4209 VM_OBJECT_WUNLOCK(object);
4210 return;
4211 }
4212 VM_OBJECT_WUNLOCK(object);
4213 }
4214 }
4215 vm_page_unwire_managed(m, PQ_INACTIVE, flags != 0);
4216}
4217
4218/* See vm_page_release(). */
4219void

Callers 3

sendfile_free_mextFunction · 0.85
sendfile_free_mext_pgFunction · 0.85
vfs_vmio_truncateFunction · 0.85

Calls 2

vm_page_release_lockedFunction · 0.85
vm_page_unwire_managedFunction · 0.85

Tested by

no test coverage detected