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

Function free_pv_chunk

freebsd/arm64/arm64/pmap.c:2500–2516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2498}
2499
2500static void
2501free_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

Callers 2

free_pv_entryFunction · 0.70
pmap_remove_pagesFunction · 0.70

Calls 6

PHYS_TO_VM_PAGEFunction · 0.85
dump_drop_pageFunction · 0.85
vm_page_unwire_noqFunction · 0.85
vm_page_freeFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected