svm_migrate_vma_to_ram(9)
π 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β thevm_area_structthat 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 fromvmf->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 π):
svm_migrate_copy_memory_gart(9)svm_migrate_copy_done(9)svm_migrate_ram_to_vram(9)svm_migrate_vram_to_ram(9)svm_migrate_vram_to_vram(9)svm_migrate_to_ram(9)
π real talk:svm_migrate_vma_to_ramis 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
- 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