drm_gpusvm_range_remove(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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:


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