drm_gpusvm_range_remove(9)
okay bestie, welcome to the drm_gpusvm_range_remove(9) page in the Kernel API Manual β this one is all about removing a GPU SVM range, and itβs giving βcleanup with consequencesβ energy π
π NAME π
drm_gpusvm_range_remove β Remove GPU SVM range. periodt.
β¨ SYNOPSIS β¨
void drm_gpusvm_range_remove (struct drm_gpusvm *gpusvm , struct
drm_gpusvm_range *range );
π«Ά ARGUMENTS π«Ά
gpusvmβ Pointer to the GPU SVM structure. thatβs the big-picture struct, the main character.rangeβ Pointer to the GPU SVM range to be removed. this is the range getting removed, no cap.
π₯ DESCRIPTION π₯
okay so this function removes the specified GPU SVM range, and it also removes the parent GPU SVM notifier if no more ranges remain in the notifier. two-for-one cleanup, iconic.
The caller must hold a lock to protect range and notifier removal. not optional, not a vibe β lock it.
This function does not unmap or free the drm_gpusvm_pages; the driver owns that lifecycle. The caller must DMA unmap the rangeβs pages before calling this function, so a range is never removed from the MMU interval tree while still DMA mapped. Typically the driver calls drm_gpusvm_unmap_pages first. And the range_free callbackβs drm_gpusvm_free_pages is a final fallback safe net.
bestie, please donβt skip the DMA unmap step. The range should not be in the MMU interval tree while still DMA mapped β thatβs the whole point π¨
π SEE ALSO π
The kernel file is ./drivers/gpu/drm/drm_gpusvm.c. Also go read:
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_range_find_or_insert(9)__drm_gpusvm_unmap_pages(9)__drm_gpusvm_free_pages(9)drm_gpusvm_free_pages(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)
Signing off from ./drivers/gpu/drm β this is the October 2026 drm_gpusvm_range_remove(9) page from the Kernel API Manual. stay safe, lock stuff, and DMA unmap before you remove, bestie π
π¦ 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