drm_gpusvm_range_alloc(9)
β¨ drm_gpusvm_range_alloc(9) β¨
okay so this is a page from the Kernel API Manual and it's about drm_gpusvm_range_alloc β the function that literally makes a GPU SVM range appear out of nowhere and gets it all set up π
bestie, it's giving "allocator but make it graphics."
πΈ NAME πΈ
drm_gpusvm_range_alloc β allocate a GPU SVM range
π SYNOPSIS π
struct drm_gpusvm_range * drm_gpusvm_range_alloc (struct drm_gpusvm
*gpusvm , struct drm_gpusvm_notifier *notifier , unsigned long
fault_addr , unsigned long chunk_size , bool migrate_devmem );
π ARGUMENTS π
gpusvmβ a pointer to the GPU SVM structure. this is the whole situation we're working inside π«Άnotifierβ a pointer to the GPU SVM notifier structurefault_addrβ the fault address. yes, that fault address πchunk_sizeβ the chunk sizemigrate_devmemβ a flag that says whether we should migrate device memory or not
π¦ DESCRIPTION π¦
this function allocates the GPU SVM range structure and initializes it. both things. in one go. iconic behavior honestly β¨
β RETURN β
on success you get a pointer to the allocated GPU SVM range π on failure you get an ERR_PTR. so likeβ¦ vibe check the return value before you use it, fr fr π
π SEE ALSO π
the kernel file ./drivers/gpu/drm/drm_gpusvm.c, plus the whole friend group:
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_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_range_find_or_insert(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)
okay that's the whole page, no cap π this one lives under ./drivers/gpu/drm, and it's dated October 2026 β so like, future era behavior π and the page itself is drm_gpusvm_range_alloc(9), periodt π bye bestie, go allocate something responsibly π§
π¦ 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