drm_gpusvm_...nd_or_insert(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

drm_gpusvm_range_find_or_insert β€” Find or insert GPU SVM range

okay bestie, this is the drm_gpusvm_...nd_or_insert(9) page from the Kernel API Manual, section 9, and it's literally here to find or insert a GPU SVM range. ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

struct drm_gpusvm_range * drm_gpusvm_range_find_or_insert (struct
       drm_gpusvm *gpusvm , unsigned long fault_addr , unsigned long
       gpuva_start , unsigned long gpuva_end , const struct drm_gpusvm_ctx *ctx
       );

πŸŽ€ ARGUMENTS πŸŽ€

  • gpusvm β€” pointer to the GPU SVM structure. that's the main character πŸ’…
  • fault_addr β€” fault address πŸ“
  • gpuva_start β€” start address of GPUVA which mirrors CPU
  • gpuva_end β€” end address of GPUVA which mirrors CPU
  • ctx β€” GPU SVM context 🫢

πŸ’… DESCRIPTION πŸ’…

This function finds or inserts a newly allocated GPU SVM range based on the fault address. periodt. 🌸

⚠️ bestie, do not forget this part: the caller must hold a lock to protect range lookup and insertion. no cap, that's the whole vibe check. πŸ”’

🌈 RETURN 🌈

Pointer to the GPU SVM range on success, ERR_PTR on failure. slay when it works, handle the ERR_PTR when it doesn't 😭✨

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/gpu/drm/drm_gpusvm.c, plus the whole reference squad in order: Overview(9), Locking(9), Partial Unmapping of Ranges(9), Examples(9), npages_in_range(9), drm_gpusvm_notifier_find(9), drm_gpusvm_range_find(9), drm_gpusvm_notifier_invalidate(9), drm_gpusvm_init(9), to_drm_gpusvm_notifier(9), drm_gpusvm_notifier_insert(9), drm_gpusvm_notifier_remove(9), drm_gpusvm_fini(9), drm_gpusvm_notifier_alloc(9), drm_gpusvm_notifier_free(9), to_drm_gpusvm_range(9), drm_gpusvm_range_insert(9), __drm_gpusvm_range_remove(9), drm_gpusvm_range_alloc(9), drm_gpusvm_hmm_pfn_to_order(9), drm_gpusvm_check_pages(9), drm_gpusvm_scan_mm(9), drm_gpusvm_range_chunk_size(9), drm_gpusvm_driver_lock_held(9), drm_gpusvm_find_vma_start(9), __drm_gpusvm_unmap_pages(9), __drm_gpusvm_free_pages(9), drm_gpusvm_free_pages(9), drm_gpusvm_range_remove(9), drm_gpusvm_range_get(9), drm_gpusvm_range_destroy(9), drm_gpusvm_range_put(9), drm_gpusvm_pages_valid(9), drm_gpusvm_pages_valid_unlocked(9), drm_gpusvm_get_pages(9), drm_gpusvm_unmap_pages(9), drm_gpusvm_range_evict(9), drm_gpusvm_has_mapping(9), drm_gpusvm_range_set_unmapped(9).


source/version: ./drivers/gpu/drm Β· date: October 2026. mwah, go slay those ranges πŸ’‹βœ¨

πŸ“¦ where this page comes from