hl_userptr_is_pinned(9)
π hl_userptr_is_pinned β like, the vibe check for pinned userptrs
okay so bestie, welcome to the kernel API manual (section 9, kernel-space girlies only) and today's main character is hl_userptr_is_pinned π β she literally just tells you whether the given userptr is pinned or not. that's it. that's the whole job. and honestly? iconic.
β¨ SYNOPSIS β¨
bool hl_userptr_is_pinned (struct hl_device *hdev , u64 addr , u32 size
, struct list_head *userptr_list , struct hl_userptr **userptr );
like look at her go, five whole parameters, she's serving function signature realness π
πΈ ARGUMENTS πΈ
hdevβ pointer to thehabanalabsdevice structure. the device in question, your fave.addrβ the user address to check. yes, that address.sizeβ the user block size to check. how big the block is, fr fr.userptr_listβ pointer to the list to clear. the list we're poking at π«Άuserptrβ pointer to userptr to check. the one we're actually asking about.
π¦ DESCRIPTION π¦
so here's what she does, step by step, no cap:
- iterates over the list and checks if the given userptr is in it β which means it's pinned. if so, returns
true. otherwise, returnsfalse. periodt. π
ngl it's giving simple, but that's the whole point β one job, done well, main character energy only π
π SEE ALSO π
kernel file ./drivers/accel/habanalabs/common/memory.c β go read her, she's long but worth it π
and the whole friend group, in order:
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)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)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)
anyway that's the page, tysm for reading, she lives in ./drivers/accel/habanalabs/common and this edition dropped in October 2026 β catch you in the next hl_userptr_is_pinned(9) bestie, mwah π§π
π¦ 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