drm_pagemap_...system_pages(9)
π drm_pagemap_migrate_map_system_pages β a Kernel API Manual moment β¨
okay so this is a page straight out of the Kernel API Manual, and bestie, it's giving "GPU memory migration but make it fashion". sit down, hydrate, let's go π«Ά
β¨ NAME β¨
drm_pagemap_migrate_map_system_pages β maps system pages or device coherent migration pages so the GPU can do its SVM migration thing. literally the matchmaker between your pages and the DMA world π
πΈ SYNOPSIS πΈ
int drm_pagemap_migrate_map_system_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 );
no cap, that's the whole signature. copy it exactly, don't freestyle it π
π ARGUMENTS π
devβ the device that's doing the migrating. main character energy, obviously πpagemap_addrβ an array where the DMA info for the mapped pages gets stashed.migrate_pfnβ array of page frame numbers of the system pages or peer pages you wanna map. the guest list, if you will πnpagesβ how many system or device coherent pages we're mapping. count 'em.dirβ direction of the data transfer (like, e.g.,DMA_BIDIRECTIONAL). which way the vibes flow πstateβ the DMA IOVA state for the mapping. it's holding the state, it's a state holder.
π¦ DESCRIPTION π¦
so what does it do? This function maps pages of memory for migration usage in GPU SVM. It literally iterates over each page frame number you handed it in migrate_pfn, maps the corresponding page, and stores that DMA address in the provided dma_addr array. one by one, page by page, slay by slay β¨
π RETURN π
0on success π- a negative error code on failure π
π SEE ALSO π
the whole friend group, gathered:
Kernel file ./drivers/gpu/drm/drm_pagemap.c, Overview(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_populate_src_pages(9), drm_pagemap_migrate_unmap_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)
π friendly reminder that the description saysdma_addrarray while the argument is calledpagemap_addrβ that's how it's written, I'm not fixing it, that's the source material bestie, iykyk.
and that's the page!! sign-off time: this one lives in ./drivers/gpu/drm and it's dated October 2026 β take care of her, she's iconic ππ§πΈ
π¦ 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