Migration(9)
π Migration π
okay so this is Migration(9) from the Kernel API Manual, and bestie, we are getting into kernel migration granularity β no cap. β¨
Migration granularity typically follows the GPU SVM range requests, but if there are clashes, due to races or due to the fact that multiple GPU SVM instances have different views of the ranges used, and because of that parts of a requested range is already present in the requested device memory, the implementation has a variety of options. It can fail and it can choose to populate only the part of the range that isn't already in device memory, and it can evict the range to system before trying to migrate. Ideally an implementation would just try to migrate the missing part of the range and allocate just enough memory to do so. π
When migrating to system memory as a response to a cpu fault or a device memory eviction request, currently a full device memory allocation is migrated back to system. Moving forward this might need improvement for situations where a single page needs bouncing between system memory and device memory due to, for example, atomic operations. π«Ά
π§© Key DRM pagemap components: π§©
- Device Memory Allocations: Embedded structure containing enough information for the
drm_pagemapto migrate to / from device memory. π - Device Memory Operations: Define the interface for driver-specific device memory operations release memory, populate pfns, and copy to / from device memory. π₯
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_pagemap.cOverview(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)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)
mwah π β source/version: ./drivers/gpu/drm, date: October 2026. thatβs the whole page, bestie, go forth and migrate responsibly π
π¦ 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