drm_pagemap..._unmap_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_pagemap_migrate_unmap_pages(9) β€” the "unmap my pages bestie" page

okay so real talk, this is a page from the Kernel API Manual (section 9, kernel-space crew only, no userland girlies allowed) and it's all about drm_pagemap_migrate_unmap_pages. yes the header is literally truncated with ... β€” that's not me being lazy, that's just how the title renders, iykyk ✨


🌸 NAME 🌸

drm_pagemap_migrate_unmap_pages β€” unmaps pages that were previously mapped for GPU SVM migration. that's it, that's the job, she's a one-trick pony and she slays at it πŸ’…


✨ SYNOPSIS ✨

void drm_pagemap_migrate_unmap_pages (struct device *dev , struct
drm_pagemap_addr *pagemap_addr , unsigned long *migrate_pfn , unsigned
long npages , enum dma_data_direction dir , struct
drm_pagemap_iova_state *state );

like, she takes six arguments and returns void β€” no receipts, no return value, she just does the thing and leaves 🫢


πŸŽ€ ARGUMENTS πŸŽ€

okay so let's meet the cast, main character energy for every single one:

  • dev β€” the device whose pages got mapped in the first place. she's the one we're cleaning up after πŸ’–
  • pagemap_addr β€” an array of DMA info, one entry per mapped page. it's giving "receipts of everything we mapped" 🧾
  • migrate_pfn β€” an array of migrate pfns set up for the mapped pages. lowkey the whole point: it's used to determine the drm_pagemap of a peer device private page πŸ‘€
  • npages β€” how many pages we're unmapping. the count. the vibe check number 🎯
  • dir β€” direction of data transfer (e.g., DMA_BIDIRECTIONAL). which way the bytes were flowing πŸ”„
  • state β€” the DMA IOVA state for the mapping. she holds it all together fr fr 🫢

πŸ”₯ DESCRIPTION πŸ”₯

so what she does: this function unmaps previously mapped pages of memory for GPU Shared Virtual Memory (SVM). it literally walks over each DMA address handed to it in pagemap_addr, checks if it's valid and not already unmapped (no double-unmapping in this house πŸ™ˆ), and then unmaps the corresponding page.

that's it. that's the whole arc. tidy, focused, no cap πŸ’…


🌈 SEE ALSO 🌈

the whole friend group, alphabetically-adjacent and absolutely iconic:


okay that's the whole page bestie, go unmap some pages responsibly πŸ’œ

she lives in ./drivers/gpu/drm, dated October 2026, filed under drm_pagemap..._unmap_pages(9) in the Kernel API Manual β€” mwah, signing off πŸŽ€πŸ’–βœ¨
πŸ“¦ where this page comes from