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

Function pmap_try_insert_pv_entry

freebsd/amd64/amd64/pmap.c:5539–5555  ·  view source on GitHub ↗

* Conditionally create the PV entry for a 4KB page mapping if the required * memory can be allocated without resorting to reclamation. */

Source from the content-addressed store, hash-verified

5537 * memory can be allocated without resorting to reclamation.
5538 */
5539static boolean_t
5540pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m,
5541 struct rwlock **lockp)
5542{
5543 pv_entry_t pv;
5544
5545 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
5546 /* Pass NULL instead of the lock pointer to disable reclamation. */
5547 if ((pv = get_pv_entry(pmap, NULL)) != NULL) {
5548 pv->pv_va = va;
5549 CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m);
5550 TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
5551 m->md.pv_gen++;
5552 return (TRUE);
5553 } else
5554 return (FALSE);
5555}
5556
5557/*
5558 * Create the PV entry for a 2MB page mapping. Always returns true unless the

Callers 2

pmap_enter_quick_lockedFunction · 0.70
pmap_copyFunction · 0.70

Calls 1

get_pv_entryFunction · 0.70

Tested by

no test coverage detected