svm_range_evict(9)
π svm_range_evict β like, the eviction queen of the kernel API manual β¨
okay so bestie, this is svm_range_evict from the Kernel API Manual, and honestly it's giving "kick everyone out of the pool so the cleaners can work" energy. let me tell you everything, no cap π«Ά
β¨ NAME β¨
svm_range_evict β literally evicts an svm range π that's it, that's the whole vibe
π¦ SYNOPSIS π¦
int svm_range_evict (struct svm_range *prange , struct mm_struct *mm ,
unsigned long start , unsigned long last , enum mmu_notifier_event event
);
she takes five args and returns an int, periodt π
π ARGUMENTS π
prangeβ the svm range structure, bestie. this is the main character of the whole function πΈmmβ the current processmm_struct. yep, the memory map of whoever's running rn π§startβ the starting process queue number β¨lastβ the last process queue number πeventβ the mmu notifier event, fired when the range gets evicted or migrated. very "something happened, pay attention" of it π
π₯ DESCRIPTION π₯
okay so here's the tea: first thing she does is stop all the queues of the process β like, every single one β so the GPU literally cannot touch that memory. safety first, always πβ¨ then she returns and lets the CPU evict the buffer and go ahead with the CPU pagetable update. slay.
and here's the iconic part: you don't need to use a lock to sync cpu pagetable invalidation with GPU execution. no cap, not needed π«Ά
but wait, what if invalidation happens while restore work is running? π don't stress β the restore work will just restart to make sure it gets the latest CPU pages mapped to the GPU, and then it starts the queues back up. she ate and left no crumbs π
π SEE ALSO π
kernel file ./drivers/gpu/drm/amd/amdkfd/kfd_svm.c plus the whole squad:
svm_range_unlink(9)svm_range_add_to_svms(9)svm_range_debug_dump(9)svm_range_split_adjust(9)svm_range_split(9)svm_range_list_lock_and_flush_work(9)svm_range_add(9)svm_range_cpu_invalidate_pagetables(9)svm_range_from_addr(9)svm_range_check_vm(9)svm_range_is_valid(9)svm_range_best_prefetch_location(9)
go read them, iykyk π
and that's the whole page bestie!! π this iconic lil manual page lives over in ./drivers/gpu/drm/amd/amdkfd and it's dated October 2026 β a whole future vibe, we love to see it βπ¦π
π¦ 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