hl_mmap_mem...e_idr_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 reached 0. 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 🫢:


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