drm_pagemap...te_to_devmem(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay bestie, this is the drm_pagemap_migrate_to_devmem(9) page from the Kernel API Manual β€” and it's literally about migrating a struct mm_struct range to device memory πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

the whole call looks like this:

int drm_pagemap_migrate_to_devmem (struct drm_pagemap_devmem
       *devmem_allocation , struct mm_struct *mm , unsigned long start ,
       unsigned long end , const struct drm_pagemap_migrate_details *mdetails
       );

πŸŽ€ ARGUMENTS πŸŽ€

  • devmem_allocation β€” the device memory allocation you're migrating to πŸ’… The caller should hold a reference to the device memory allocation, and that reference is consumed by this function even if it returns with an error. yes, consumed even on error β€” no take-backs 😭
  • mm β€” pointer to the struct mm_struct.
  • start β€” start of the virtual address range to migrate.
  • end β€” end of the virtual address range to migrate.
  • mdetails β€” the details that govern the migration.

🌸 DESCRIPTION 🌸

This function migrates the specified virtual address range to device memory. It does the necessary setup and invokes the driver-specific operations for migration to device memory. Expected to be called while holding the mmap lock in at least read mode πŸ‘‘


πŸ’€ NOTE πŸ’€

The timeslice_ms parameter can typically be used to force data to remain in pagemap pages long enough for a GPU to perform a task and to prevent a migration livelock. One alternative would be for the GPU driver to block in a mmu_notifier for the specified amount of time, but adding the functionality to the pagemap is likely nicer to the system as a whole ✨


πŸ”₯ RETURN πŸ”₯

0 on success, negative error code on failure 🫢


🌈 SEE ALSO 🌈

Kernel file: ./drivers/gpu/drm/drm_pagemap.c β€” and the whole reference squad is:


and that's the whole page, bestie πŸ’– this one came from ./drivers/gpu/drm, dated October 2026 β€” mwah πŸ’…

πŸ“¦ where this page comes from