drm_gpusvm_unmap_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_gpusvm_unmap_pages(9) β€” from the Kernel API Manual, bestie ✨

okay so picture this: you're deep in drivers/gpu/drm, it's late, and you need to unmap some GPU SVM pages. this is that page. the function is drm_gpusvm_unmap_pages, and yes it's a kernel API manual entry, and yes we're gonna get through it together 🫢


✨ NAME ✨

drm_gpusvm_unmap_pages β€” literally just unmaps GPU svm pages πŸ’… no cap, that's the whole job


🌸 SYNOPSIS 🌸

void drm_gpusvm_unmap_pages (struct drm_gpusvm *gpusvm , struct
drm_gpusvm_pages *svm_pages , unsigned long npages , const struct
drm_gpusvm_ctx *ctx );

returns void, takes four things, that's the vibe πŸŽ€


πŸŽ€ ARGUMENTS πŸŽ€

  • gpusvm β€” pointer to the GPU SVM structure. iconic. it's the whole world this function lives in ✨
  • svm_pages β€” pointer to the GPU SVM pages structure. the actual pages-containing little guy πŸ¦‹
  • npages β€” number of pages in svm_pages. like, how many. counting matters, bestie πŸ”₯
  • ctx β€” GPU SVM context. the const one. we respect it πŸ’œ

πŸ‘‘ DESCRIPTION πŸ‘‘

so this function unmaps pages associated with a GPU SVM pages struct. that's the main character move 🎯

now here's the part where you gotta pay attention, because it's giving important:

if in_notifier is set, it is assumed that gpusvm->notifier_lock is held in write mode. if it's clear, it acquires gpusvm->notifier_lock in read mode. two different lock situations, and you do NOT get to vibe-check your way past it πŸ™ˆ

⚠️ and this one's non-negotiable: it must be called in the invalidate callback of the corresponding notifier for the IOMMU security model. like, must must. not "eh probably". fr fr πŸ’€

🌈 SEE ALSO 🌈

okay this list is LONG, so buckle up, we're going through all of it, no skipping, i love you but i'm not summarising 40+ entries πŸ“


and that's the page, bestie πŸ’– go forth and unmap responsibly 🧚

πŸŽ€ source path ./drivers/gpu/drm, dated October 2026 β€” that's the sign-off, mwah, slay, periodt πŸ‘‘
πŸ“¦ where this page comes from