hl_mmap_mem...e_idr_locked(9)
π hl_mmap_mem...e_idr_locked(9) π
okay bestie, welcome to the Kernel API Manual β¨ this one's a tiny little internal helper from the habanalabs driver and honestly she's short but she MATTERS, so let's get into it π«Ά
πΈ NAME πΈ
hl_mmap_mem_buf_remove_idr_locked β say it with me: remove handle from idr π« that's the whole job, that's the assignment, and she ate.
β¨ SYNOPSIS β¨
void hl_mmap_mem_buf_remove_idr_locked (struct kref *kref );
no return value, no drama, just vibes and a void. π
π ARGUMENTS π
krefβ the kref that reached0. like, she's done, she's clocked out, reference count hit zero, main character exit moment π
π¦ DESCRIPTION π¦
so this is an internal function, meaning it's not out here for public consumption β it gets used for the kref put by handle. iykyk π₯
it assumes the mmg lock is taken. not "checks if", not "politely asks" β assumes. so if you're calling this without holding that lock, that's on you bestie, no cap π
what does it actually do? it will remove the buffer from the idr, without destroying it. key distinction!! she removes, she does not destroy. those are two different girls and you do NOT want to confuse them π
lowkey important: this is the "get it out of the idr" step only. the destroying part lives somewhere else (hl_mmap_mem_buf_destroy(9), we'll get there). don't come for this function's wig about cleanup she didn't sign up for π
π SEE ALSO π
the kernel file where all the magic lives, periodt:
./drivers/accel/habanalabs/common/memory_mgr.c
and the whole friend group π«Ά:
hl_mmap_mem_buf_get(9)hl_mmap_mem_buf_destroy(9)hl_mmap_mem_buf_release(9)hl_mmap_mem_buf_put(9)hl_mmap_mem_buf_put_handle(9)hl_mmap_mem_buf_alloc(9)hl_mmap_mem_buf_vm_close(9)hl_mem_mgr_mmap(9)hl_mem_mgr_init(9)hl_mem_mgr_fini(9)hl_mem_mgr_idr_destroy(9)
okay that's the whole page, you're officially educated π this cutie lives over in ./drivers/accel/habanalabs/common, and she was documented way back in October 2026 β iconic behavior honestly, stan forever πβ¨π
π¦ 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