amdgpu_vm_lock_by_pasid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– amdgpu_vm_lock_by_pasid(9) πŸ’–

okay so bestie, we're looking at amdgpu_vm_lock_by_pasid from the Kernel API Manual β€” and no cap, this one's a little baddie that does exactly what it says on the tin: it finds a VM by its PASID and locks that root PD. let's get into it ✨


🌸 SYNOPSIS 🌸

struct amdgpu_vm * amdgpu_vm_lock_by_pasid (struct amdgpu_device *adev ,
u32 pasid , struct drm_exec *exec );

like, she takes three things and gives you back a VM pointer (or doesn't, we'll get there πŸ‘€)


πŸŽ€ ARGUMENTS πŸŽ€

  • adev β€” the amdgpu device pointer, aka the whole vibe of your GPU right here
  • pasid β€” the PASID of the VM, her little ID badge so you know which one you're locking
  • exec β€” the drm_exec context where we're locking the root PD in, this is the container she does her work in, periodt

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” this function must be called from inside a drm_exec_until_all_locked loop. and then the caller runs drm_exec_retry_on_contention afterwards. like, that's the rules, okay?

the drm_exec context holds a reference on the root BO until it gets finalised. so she's holding onto it, keeping it safe, main character energy fr fr πŸ’…


⭐ RETURN ⭐

you get the VM on success, slay πŸŽ‰ β€” OR you get NULL if:

  • the PASID has no VM (sad, empty, no vibes)
  • the VM is being torn down (rip to her)
  • or locking the root PD failed 😭

so like, check your return value bestie, don't assume ✨


🌈 SEE ALSO 🌈

okay this list is long so buckle up buttercup, she references a LOT of her friends:

like I said β€” she knows everyone πŸ’… iykyk


that's the whole page bestie, go forth and lock those root PDs responsibly 🫢

and like, credit where it's due β€” this whole thing lives in ./drivers/gpu/drm/amd/amdgpu, dated October 2026, and yes it's giving very much official Kernel API Manual realness. bye bestie, mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from