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

Function vm_page_wire

freebsd/vm/vm_page.c:3900–3922  ·  view source on GitHub ↗

* Mark this page as wired down. For managed pages, this prevents reclamation * by the page daemon, or when the containing object, if any, is destroyed. */

Source from the content-addressed store, hash-verified

3898 * by the page daemon, or when the containing object, if any, is destroyed.
3899 */
3900void
3901vm_page_wire(vm_page_t m)
3902{
3903 u_int old;
3904
3905#ifdef INVARIANTS
3906 if (m->object != NULL && !vm_page_busied(m) &&
3907 !vm_object_busied(m->object))
3908 VM_OBJECT_ASSERT_LOCKED(m->object);
3909#endif
3910 KASSERT((m->flags & PG_FICTITIOUS) == 0 ||
3911 VPRC_WIRE_COUNT(m->ref_count) >= 1,
3912 ("vm_page_wire: fictitious page %p has zero wirings", m));
3913
3914 old = atomic_fetchadd_int(&m->ref_count, 1);
3915 KASSERT(VPRC_WIRE_COUNT(old) != VPRC_WIRE_COUNT_MAX,
3916 ("vm_page_wire: counter overflow for page %p", m));
3917 if (VPRC_WIRE_COUNT(old) == 0) {
3918 if ((m->oflags & VPO_UNMANAGED) == 0)
3919 vm_page_aflag_set(m, PGA_DEQUEUE);
3920 vm_wire_add(1);
3921 }
3922}
3923
3924/*
3925 * Attempt to wire a mapped page following a pmap lookup of that page.

Callers 9

vm_page_tryacquireFunction · 0.85
vm_page_acquire_unlockedFunction · 0.85
vm_page_grab_validFunction · 0.85
vm_fault_soft_fastFunction · 0.85
vm_fault_populateFunction · 0.85
vm_fault_cowFunction · 0.85
vm_faultFunction · 0.85
vm_fault_copy_entryFunction · 0.85

Calls 4

vm_object_busiedFunction · 0.85
vm_page_aflag_setFunction · 0.85
vm_wire_addFunction · 0.85
atomic_fetchadd_intFunction · 0.50

Tested by

no test coverage detected