* Conditionally create the PV entry for a 4KB page mapping if the required * memory can be allocated without resorting to reclamation. */
| 2769 | * memory can be allocated without resorting to reclamation. |
| 2770 | */ |
| 2771 | static boolean_t |
| 2772 | pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m, |
| 2773 | struct rwlock **lockp) |
| 2774 | { |
| 2775 | pv_entry_t pv; |
| 2776 | |
| 2777 | PMAP_LOCK_ASSERT(pmap, MA_OWNED); |
| 2778 | /* Pass NULL instead of the lock pointer to disable reclamation. */ |
| 2779 | if ((pv = get_pv_entry(pmap, NULL)) != NULL) { |
| 2780 | pv->pv_va = va; |
| 2781 | CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m); |
| 2782 | TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); |
| 2783 | m->md.pv_gen++; |
| 2784 | return (TRUE); |
| 2785 | } else |
| 2786 | return (FALSE); |
| 2787 | } |
| 2788 | |
| 2789 | /* |
| 2790 | * Create the PV entry for a 2MB page mapping. Always returns true unless the |
no test coverage detected