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

Function vm_page_release_locked

freebsd/vm/vm_page.c:4219–4245  ·  view source on GitHub ↗

See vm_page_release(). */

Source from the content-addressed store, hash-verified

4217
4218/* See vm_page_release(). */
4219void
4220vm_page_release_locked(vm_page_t m, int flags)
4221{
4222
4223 VM_OBJECT_ASSERT_WLOCKED(m->object);
4224 KASSERT((m->oflags & VPO_UNMANAGED) == 0,
4225 ("vm_page_release_locked: page %p is unmanaged", m));
4226
4227 if (vm_page_unwire_noq(m)) {
4228 if ((flags & VPR_TRYFREE) != 0 &&
4229 (m->object->ref_count == 0 || !pmap_page_is_mapped(m)) &&
4230 m->dirty == 0 && vm_page_tryxbusy(m)) {
4231 /*
4232 * An unlocked lookup may have wired the page before the
4233 * busy lock was acquired, in which case the page must
4234 * not be freed.
4235 */
4236 if (__predict_true(!vm_page_wired(m))) {
4237 vm_page_free(m);
4238 return;
4239 }
4240 vm_page_xunbusy(m);
4241 } else {
4242 vm_page_release_toq(m, PQ_INACTIVE, flags != 0);
4243 }
4244 }
4245}
4246
4247static bool
4248vm_page_try_blocked_op(vm_page_t m, void (*op)(vm_page_t))

Callers 3

vfs_vmio_invalidateFunction · 0.85
vfs_vmio_truncateFunction · 0.85
vm_page_releaseFunction · 0.85

Calls 6

vm_page_unwire_noqFunction · 0.85
vm_page_tryxbusyFunction · 0.85
vm_page_wiredFunction · 0.85
vm_page_freeFunction · 0.85
vm_page_release_toqFunction · 0.85
pmap_page_is_mappedFunction · 0.50

Tested by

no test coverage detected