svm_range_be...tch_location(9)
β¨ svm_range_best_prefetch_location β it's giving "where should we prefetch tho" β¨
okay bestie, so this one is from the Kernel API Manual, page svm_range_best_prefetch_location(9) β yes that's a long name, she's got main character energy, we stan π
π NAME π
svm_range_best_prefetch_location β literally decides the best prefetch location. that's it. that's the whole job. π
πΈ SYNOPSIS πΈ
uint32_t svm_range_best_prefetch_location (struct svm_range *prange );
π¦ ARGUMENTS π¦
prangeβ the svm range structure, aka the little data baby we're judging π
β DESCRIPTION β
alright so this is the whole vibe check, and it depends on whether xnack is off or on. buckle up π«Ά
π for xnack off:
if the range maps to a single GPU, then the best prefetch location is prefetch_loc β and that can be CPU or GPU. easy, no drama β¨
but if the range is ACCESS or ACCESS_IN_PLACE by mGPUs, then it's only prefetch_loc GPU when the mGPU connection is on XGMI same hive. otherwise? best prefetch location is always CPU. and why, you ask? because a GPU can't have coherent mapping of another GPU's VRAM β not even with a large-BAR PCIe connection. like, she simply cannot. nope π
π for xnack on:
if the range is not ACCESS_IN_PLACE by mGPUs, then best prefetch location is prefetch_loc, and any other GPU access will generate a vm fault and trigger migration. it's giving "consequences" π
if the range is ACCESS_IN_PLACE by mGPUs, then it's only prefetch_loc GPU when the mGPU connection is on XGMI same hive β otherwise the best prefetch location is always CPU. periodt π
π§ CONTEXT π§
Process context π«‘
π₯ RETURN π₯
Returns 0 for CPU, or a GPU id π
π SEE ALSO π
Kernel file ./drivers/gpu/drm/amd/amdkfd/kfd_svm.c, bestie, plus the whole friend group:
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_evict(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)
okay that's the page, mwah π this lives in ./drivers/gpu/drm/amd/amdkfd, dated October 2026, and it's svm_range_best_prefetch_location(9) β go be iconic with 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