free_phys_pg_pack(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_pack structure. 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's free_phys_pg_pack(9) all the way down. slay, go free those packs, ily πŸ«ΆπŸ’œπŸŒΈ
πŸ“¦ where this page comes from