* Conditionally create the PV entry for a 4KB page mapping if the required * memory can be allocated without resorting to reclamation. */
| 5537 | * memory can be allocated without resorting to reclamation. |
| 5538 | */ |
| 5539 | static boolean_t |
| 5540 | pmap_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 |
no test coverage detected