free_phys_pg_pack(9)
π free_phys_pg_pack(9) β like, the Kernel API Manual page, bestie β¨
okay so this is free_phys_pg_pack(9), straight out of the Kernel API Manual, and it's literally the cleanup era of physical page packs. no cap, it's giving "the party's over, everybody out" π
πΈ NAME πΈ
free_phys_pg_pack β free physical page pack. that's it. that's the whole vibe. it frees a physical page pack π«Ά
β¨ SYNOPSIS β¨
void free_phys_pg_pack (struct hl_device *hdev , struct
hl_vm_phys_pg_pack *phys_pg_pack );
so it returns void (no receipts, no return value, it just does the thing π
) and it takes exactly two things. copy it exactly, bestie, don't get creative:
void free_phys_pg_pack(struct hl_device *hdev, struct hl_vm_phys_pg_pack *phys_pg_pack);
π¦ ARGUMENTS π¦
hdevβ the habanalabs device structure. like, the actual device we're talking about here π₯phys_pg_packβ the physical page pack to free. yes queen, this is the one going to the farm upstate π
π DESCRIPTION π
okay so here's what this function actually does, in order, no skipping:
- For DRAM memory only β only DRAM, okay? not everything, just DRAM π
- iterate over the pack, free each physical block structure by returning it to the general pool. one by one, block by block, sending them all home π β¨
- Free the
hl_vm_phys_pg_packstructure. the pack itself? also gone. iconic behavior, honestly π
π SEE ALSO π
the source lives at the kernel file ./drivers/accel/habanalabs/common/memory.c β that's the origin story π§
and here's the whole friend group, everyone invited to the function reunion, in exactly this order:
dma_map_host_va(9), dma_unmap_host_va(9), dram_pg_pool_do_release(9), free_device_memory(9), clear_va_list_locked(9), print_va_list_locked(9), merge_va_blocks_locked(9), add_va_block_locked(9), add_va_block(9), is_hint_crossing_range(9), get_va_block(9), hl_get_va_range_type(9), hl_unreserve_va_block(9), init_phys_pg_pack_from_userptr(9), map_phys_pg_pack(9), unmap_phys_pg_pack(9), map_device_va(9), unmap_device_va(9), hl_hw_block_mmap(9), export_dmabuf_from_addr(9), allocate_timestamps_buffers(9), hl_pin_host_memory(9), hl_userptr_delete_list(9), hl_userptr_is_pinned(9), va_range_init(9), va_range_fini(9), vm_ctx_init_with_ranges(9), hl_vm_ctx_fini(9), hl_vm_init(9), hl_vm_fini(9), hl_hw_block_mem_init(9), hl_hw_block_mem_fini(9)
lowkey reminder: this page is filed under./drivers/accel/habanalabs/common, dated October 2026, and it'sfree_phys_pg_pack(9)all the way down. slay, go free those packs, ily π«ΆππΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms