svm_migrate_vma_to_ram(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… svm_migrate_vma_to_ram(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so picture this: you're deep in the Kernel API Manual (section 9, the ~cool driver devs~ section) and you stumble on svm_migrate_vma_to_ram. no cap, she's the one who moves your stuff from the device back to system memory, one vma at a time. let me break it down 🫢


✨ NAME ✨

svm_migrate_vma_to_ram β€” migrate a range inside one vma from the device over to system memory. that's it, that's the whole gig πŸ’…


🌸 SYNOPSIS 🌸

long svm_migrate_vma_to_ram (struct kfd_node *node , struct svm_range
*prange , struct vm_area_struct *vma , u64 start , u64 end , uint32_t
trigger , struct page *fault_page );

seven (7) arguments, literally iconic behavior, we'll get to each one πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • node β€” the kfd node device you're migrating from. like, the GPU in question, bestie.
  • prange β€” the svm range structure. the main character of this whole operation ngl.
  • vma β€” the vm_area_struct that the [start, end] range belongs to. yes, the very same one.
  • start β€” range start virtual address, in pages πŸ“
  • end β€” range end virtual address, in pages πŸ“
  • trigger β€” the reason this migration is even happening. the lore, if you will πŸ™ˆ
  • fault_page β€” comes straight from vmf->page, svm_migrate_to_ram; this is the CPU page fault callback. she's the reason we're all here fr fr πŸ’€

🧚 CONTEXT 🧚

process context only, bestie. and the caller is holding the mmap read lock and prange->migrate_mutex. both of them. don't come in without them, that's not the vibe 🚫


⭐ RETURN ⭐

  • negative values β†’ indicates an error 😭 (something went wrong, handle it)
  • positive values or zero β†’ the number of pages that actually got migrated ✨

πŸ”₯ SEE ALSO πŸ”₯

the kernel file, in all her glory:

./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c

and her friends (a whole friend group, obsessed πŸ’œ):


πŸ’– real talk: svm_migrate_vma_to_ram is a <hotpink>serious kernel function</hotpink>, so treat her with respect β€” proper context, proper locks, no shortcuts, periodt.

okay that's the whole page, bestie, you ate that πŸ“šβœ¨ this came to you from ./drivers/gpu/drm/amd/amdkfd, dated <purple>October 2026</purple>, and this manual page is literally named svm_migrate_vma_to_ram(9) β€” mwah, go read some more man pages πŸ’‹πŸŽ€

πŸ“¦ where this page comes from