drm_pagemap..._unmap_pages(9)
π 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 thedrm_pagemapof 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:
- Kernel file
./drivers/gpu/drm/drm_pagemap.cOverview(9) - Migration(9)
- struct drm_pagemap_zdd(9)
- drm_pagemap_zdd_alloc(9)
- drm_pagemap_zdd_get(9)
- drm_pagemap_zdd_destroy(9)
- drm_pagemap_zdd_put(9)
- drm_pagemap_migration_unlock_put_folio(9)
- drm_pagemap_migration_unlock_put_pages(9)
- drm_pagemap_get_devmem_page(9)
- drm_pagemap_migrate_map_device_private_pages(9)
- struct drm_pagemap_iova_state(9)
- drm_pagemap_migrate_map_system_pages(9)
- drm_pagemap_migrate_populate_src_pages(9)
- struct migrate_range_loc(9)
- drm_pagemap_cpages(9)
- drm_pagemap_migrate_to_devmem(9)
- drm_pagemap_migrate_populate_ram_pfn(9)
- struct drm_pagemap_dev_hold(9)
- drm_pagemap_reinit(9)
- drm_pagemap_init(9)
- drm_pagemap_put(9)
- drm_pagemap_page_get_flags(9)
- drm_pagemap_page_set_flags(9)
- drm_pagemap_retire_migrated_pages(9)
- drm_pagemap_skip_retired_pages(9)
- drm_pagemap_evict_to_ram(9)
- __drm_pagemap_migrate_to_ram(9)
- drm_pagemap_folio_free(9)
- drm_pagemap_migrate_to_ram(9)
- drm_pagemap_pagemap_ops_get(9)
- drm_pagemap_devmem_init(9)
- drm_pagemap_page_to_dpagemap(9)
- drm_pagemap_populate_mm(9)
okay that's the whole page bestie, go unmap some pages responsibly π
she lives in./drivers/gpu/drm, dated October 2026, filed underdrm_pagemap..._unmap_pages(9)in the Kernel API Manual β mwah, signing off ππβ¨
π¦ 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