Changeset View
Changeset View
Standalone View
Standalone View
head/sys/riscv/riscv/pmap.c
Show First 20 Lines • Show All 1,642 Lines • ▼ Show 20 Lines | free_pv_chunk(struct pv_chunk *pc) | ||||
TAILQ_REMOVE(&pv_chunks, pc, pc_lru); | TAILQ_REMOVE(&pv_chunks, pc, pc_lru); | ||||
mtx_unlock(&pv_chunks_mutex); | mtx_unlock(&pv_chunks_mutex); | ||||
PV_STAT(atomic_subtract_int(&pv_entry_spare, _NPCPV)); | PV_STAT(atomic_subtract_int(&pv_entry_spare, _NPCPV)); | ||||
PV_STAT(atomic_subtract_int(&pc_chunk_count, 1)); | PV_STAT(atomic_subtract_int(&pc_chunk_count, 1)); | ||||
PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); | PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); | ||||
/* entire chunk is free, return it */ | /* entire chunk is free, return it */ | ||||
m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); | m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); | ||||
dump_drop_page(m->phys_addr); | dump_drop_page(m->phys_addr); | ||||
vm_page_unwire(m, PQ_NONE); | vm_page_unwire_noq(m); | ||||
vm_page_free(m); | vm_page_free(m); | ||||
} | } | ||||
/* | /* | ||||
* Returns a new PV entry, allocating a new PV chunk from the system when | * Returns a new PV entry, allocating a new PV chunk from the system when | ||||
* needed. If this PV chunk allocation fails and a PV list lock pointer was | * needed. If this PV chunk allocation fails and a PV list lock pointer was | ||||
* given, a PV chunk is reclaimed from an arbitrary pmap. Otherwise, NULL is | * given, a PV chunk is reclaimed from an arbitrary pmap. Otherwise, NULL is | ||||
* returned. | * returned. | ||||
▲ Show 20 Lines • Show All 2,809 Lines • Show Last 20 Lines |