| 2498 | } |
| 2499 | |
| 2500 | static void |
| 2501 | free_pv_chunk(struct pv_chunk *pc) |
| 2502 | { |
| 2503 | vm_page_t m; |
| 2504 | |
| 2505 | mtx_lock(&pv_chunks_mutex); |
| 2506 | TAILQ_REMOVE(&pv_chunks, pc, pc_lru); |
| 2507 | mtx_unlock(&pv_chunks_mutex); |
| 2508 | PV_STAT(atomic_subtract_int(&pv_entry_spare, _NPCPV)); |
| 2509 | PV_STAT(atomic_subtract_int(&pc_chunk_count, 1)); |
| 2510 | PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); |
| 2511 | /* entire chunk is free, return it */ |
| 2512 | m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); |
| 2513 | dump_drop_page(m->phys_addr); |
| 2514 | vm_page_unwire_noq(m); |
| 2515 | vm_page_free(m); |
| 2516 | } |
| 2517 | |
| 2518 | /* |
| 2519 | * Returns a new PV entry, allocating a new PV chunk from the system when |
no test coverage detected