svm_migrate_ram_to_vram(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… svm_migrate_ram_to_vram(9)

okay so bestie, welcome to the Kernel API Manual β€” yes that's the manual name, we're in the big-leagues kernel docs now ✨

🌸 NAME 🌸

svm_migrate_ram_to_vram β€” bestie this literally migrates an svm range from system memory to device memory, and ngl that's the whole vibe πŸ¦‹

✨ SYNOPSIS ✨

int svm_migrate_ram_to_vram (struct svm_range *prange , uint32_t
best_loc , unsigned long start_mgr , unsigned long last_mgr , struct
mm_struct *mm , uint32_t trigger );

like, that's the whole signature, no cap β€” copy it exactly bestie πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • prange β€” the range structure, the main character of this whole operation πŸ‘‘
  • best_loc β€” the device we're migrating to, i.e. the destination of the whole glow-up πŸ¦‹
  • start_mgr β€” start page to migrate, where the journey begins 🌸
  • last_mgr β€” last page to migrate, where the journey ends πŸŽ€
  • mm β€” the process mm structure, yes that one, the memory-map one πŸ’œ
  • trigger β€” the reason of migration, like why are we doing this, what's the lore 😭

πŸ”₯ CONTEXT πŸ”₯

So here's the thing bestie β€” this runs in process context, and the caller has to hold the mmap read lock, the svms lock, and the prange lock. All three. Not optional. The way that's non-negotiable fr fr πŸ”’

bestie do NOT call this without holding all three locks, that's giving undefined-behaviour disaster energy πŸ’€

⭐ RETURN ⭐

0 β€” OK, slay, it worked πŸŽ‰

otherwise β€” an error code, so like, it didn't work, and you get to find out why πŸ™ˆ

🌈 SEE ALSO 🌈

like, the whole migrate friend group, obsessed 🫢


and that's the page bestie!! πŸ’– it lives under ./drivers/gpu/drm/amd/amdkfd, and this lil edition is dated October 2026 β€” see you in the next svm_migrate_ram_to_vram(9) era, periodt βœ¨πŸ’…

πŸ“¦ where this page comes from