init_phys_pg...from_userptr(9)
π init_phys_pg_pack_from_userptr β Kernel API Manual, bestie edition β¨
okay so the page is literally called init_phys_pg...from_userptr(9) (yes that's the shortened header, the full name lives down in NAME, don't come for me π) and it's giving "kernel internals but make it cute". Buckle up π
β¨ NAME β¨
init_phys_pg_pack_from_userptr β initialize a physical page pack from host memory π«Ά
πΈ SYNOPSIS πΈ
int init_phys_pg_pack_from_userptr (struct hl_ctx *ctx , struct hl_userptr *userptr , struct hl_vm_phys_pg_pack **pphys_pg_pack , bool force_regular_page );
π ARGUMENTS π
ctxβ pointer to the context structure, bestie. that's the whole vibe.userptrβ the userptr you're initializing from πΈpphys_pg_packβ the result pointer. this is where the good stuff lands, no cap.force_regular_pageβ tells the function to ignore the huge page optimization, even if it's possible π€. needed for cases where the device VA is allocated before we know the composition of the physical pages β iykyk, timing is everything.
π¦ DESCRIPTION π¦
this function does the following, and honestly? iconic behavior:
- create a physical page pack from the physical pages related to the given virtual block. literally that's the job. slay. π
π SEE ALSO π
the kernel file it lives in is ./drivers/accel/habanalabs/common/memory.c β go read the source, it's like the group chat archive fr fr.
and the friend group π, all in (9):
dma_map_host_va(9)dma_unmap_host_va(9)dram_pg_pool_do_release(9)free_phys_pg_pack(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)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)
ok that's the whole page, nothing skipped, every single option and reference accounted for π go be a main character in the kernel π§
and like, mandatory sign-off credits moment π: this masterpiece comes from ./drivers/accel/habanalabs/common, dated October 2026, and the page answers to init_phys_pg...from_userptr(9) β bye bestie, drink water π
π¦ 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