drm_gpuvm_bo_put(9)
π drm_gpuvm_bo_put(9) β from the Kernel API Manual, bestie π
okay so picture this: it's a Kernel API Manual kind of day, you've got a struct drm_gpuvm_bo in your hands, and you need to let go of one of its references. That's literally this function. No cap. β¨
πΈ NAME πΈ
drm_gpuvm_bo_put β drop a struct drm_gpuvm_bo reference. yes it's that simple and yes it still matters π
π¦ SYNOPSIS π¦
bool drm_gpuvm_bo_put (struct drm_gpuvm_bo *vm_bo );
π ARGUMENTS π
vm_boβ thedrm_gpuvm_boyou're releasing the reference of. give it a little goodbye wave π
β¨ DESCRIPTION β¨
So this releases a reference to vm_bo. That's the whole bit. π«Ά
But here's where it gets real: if the reference count drops to zero, the gpuvm_bo is destroyed, and that includes removing it from the GEM's gpuva list. So β if a call to this function can potentially let the reference count drop to zero, the caller must hold the lock that the GEM uses for its gpuva list. Which one? Either the GEM's dma-resv or gpuva.lock mutex. The GEM's dma-resv or the gpuva.lock mutex. Pick one, hold it, keep it. π
β οΈ also, this function may only be called from non-atomic context. not atomic. do not pass go. not me making that mistake ever again π
π RETURN π
trueifvm_bowas destroyedfalseotherwise
that's it. that's the return. iconic honestly π
π₯ SEE ALSO π₯
the whole friend group, fr fr β starting with the kernel file ./drivers/gpu/drm/drm_gpuvm.c:
Overview(9)Split and Merge(9)Madvise Logic - Splitting and Traversal(9)Locking(9)Examples(9)get_next_vm_bo_from_list(9)for_each_vm_bo_in_list(9)restore_vm_bo_list(9)drm_gpuvm_bo_is_zombie(9)drm_gpuvm_bo_list_add(9)drm_gpuvm_bo_list_del_init(9)drm_gpuvm_bo_list_del(9)drm_gpuvm_range_valid(9)drm_gpuvm_resv_object_alloc(9)drm_gpuvm_init(9)drm_gpuvm_put(9)drm_gpuvm_prepare_vm(9)drm_gpuvm_prepare_objects(9)drm_gpuvm_prepare_range(9)drm_gpuvm_exec_lock(9)drm_gpuvm_exec_lock_array(9)drm_gpuvm_exec_lock_range(9)drm_gpuvm_validate(9)drm_gpuvm_resv_add_fence(9)drm_gpuvm_bo_create(9)drm_gpuvm_bo_put_deferred(9)drm_gpuvm_bo_deferred_cleanup(9)drm_gpuvm_bo_find(9)drm_gpuvm_bo_obtain_locked(9)drm_gpuvm_bo_obtain_prealloc(9)drm_gpuvm_bo_extobj_add(9)drm_gpuvm_bo_evict(9)drm_gpuva_insert(9)drm_gpuva_remove(9)drm_gpuva_link(9)drm_gpuva_unlink(9)drm_gpuva_unlink_defer(9)drm_gpuva_find_first(9)drm_gpuva_find(9)drm_gpuvm_interval_empty(9)drm_gpuva_map(9)drm_gpuva_remap(9)drm_gpuva_unmap(9)drm_gpuvm_sm_map(9)drm_gpuvm_sm_unmap(9)drm_gpuvm_sm_map_exec_lock(9)drm_gpuvm_sm_unmap_exec_lock(9)drm_gpuvm_sm_map_ops_create(9)drm_gpuvm_madvise_ops_create(9)drm_gpuvm_sm_unmap_ops_create(9)drm_gpuvm_prefetch_ops_create(9)drm_gpuvm_bo_unmap_ops_create(9)drm_gpuva_ops_free(9)
and that's the tea β this page lives in ./drivers/gpu/drm, stamped October 2026, and it goes by drm_gpuvm_bo_put(9). 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