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

Function vm_page_wire_mapped

freebsd/vm/vm_page.c:3931–3950  ·  view source on GitHub ↗

* Attempt to wire a mapped page following a pmap lookup of that page. * This may fail if a thread is concurrently tearing down mappings of the page. * The transient failure is acceptable because it translates to the * failure of the caller pmap_extract_and_hold(), which should be then * followed by the vm_fault() fallback, see e.g. vm_fault_quick_hold_pages(). */

Source from the content-addressed store, hash-verified

3929 * followed by the vm_fault() fallback, see e.g. vm_fault_quick_hold_pages().
3930 */
3931bool
3932vm_page_wire_mapped(vm_page_t m)
3933{
3934 u_int old;
3935
3936 old = m->ref_count;
3937 do {
3938 KASSERT(old > 0,
3939 ("vm_page_wire_mapped: wiring unreferenced page %p", m));
3940 if ((old & VPRC_BLOCKED) != 0)
3941 return (false);
3942 } while (!atomic_fcmpset_int(&m->ref_count, &old, old + 1));
3943
3944 if (VPRC_WIRE_COUNT(old) == 0) {
3945 if ((m->oflags & VPO_UNMANAGED) == 0)
3946 vm_page_aflag_set(m, PGA_DEQUEUE);
3947 vm_wire_add(1);
3948 }
3949 return (true);
3950}
3951
3952/*
3953 * Release a wiring reference to a managed page. If the page still belongs to

Callers 5

pmap_extract_and_holdFunction · 0.85
pmap_extract_and_holdFunction · 0.85
pmap_extract_and_holdFunction · 0.85
pmap_extract_and_holdFunction · 0.85

Calls 2

vm_page_aflag_setFunction · 0.85
vm_wire_addFunction · 0.85

Tested by

no test coverage detected